| @@ -145,10 +145,10 @@ | ||
| 145 | 145 | $site_id = $this->parsely->get_site_id(); |
| 146 | 146 | $post_id = Utils::get_post_id_by_url( $item['url'] ); |
| 147 | 147 | $post_url = Parsely::get_url_with_itm_source( $item['url'], null ); |
| 148 | 148 | |
| 149 | - // If we have a post ID, update the post canonical URL. | |
| 150 | - if ( 0 !== $post_id ) { | |
| 149 | + // Only updates the canonical URL of posts the current user can edit. | |
| 150 | + if ( 0 !== $post_id && current_user_can( 'edit_post', $post_id ) ) { | |
| 151 | 151 | Parsely::set_canonical_url( $post_id, $post_url ); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | if ( Utils::parsely_is_https_supported() ) { |