Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Can canonicals be implemented in bulk on wordpress sites?

         

Andiamo

8:10 am on Dec 18, 2019 (gmt 0)

10+ Year Member



Hi -

I want to implement canonical link elements on my WordPress website. The canonicals will point to the original content on another site.

For example -

https://www.example.com/content-id-455675/

would have a canonical link element pointing to:

https://www.example 2.com/content-id-455675/

The only difference between the URLs would be the domain.

Is there a way to implement these canonical link elements in bulk using .htaccess, since they follow specific rules (i.e. substituting the domain each time)?

Alternately, is there a WordPress plugin that would do this, so I don't have to go page-by-page to implement canonicals?

Thanks!

[edited by: engine at 7:52 pm (utc) on Dec 18, 2019]
[edit reason] pleaase use example.com [/edit]

not2easy

6:05 pm on Dec 18, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You can implement canonical links with the free version of Yoast's SEO plugin which many people use for sitemaps and other management tasks. Keep in mind that Google does not automatically follow your preferences expressed in the canonical meta-tag. The target page of the canonical must be substantially similar to the content of the page where you add that meta tag.

The canonical meta tag is a physical part of the page where it is applied, so there is not a way to use a rewrite rule in .htaccess for making the changes. Rewrite rules can change requests but not textual meta content of pages. Because of the way WP creates URLs on the fly and shows the same content under multiple URLs you would need to have that meta data as a part of the content at the originating URL.