Programmatically alter Canonical URLS
-
We have developed a bespoke multilingual solution for a client, which prepends languages to permalinks based on rewrite rules and query vars. Languages are simple custom fields that are displayed in place of normal English content when the query var is detected – basically, there are no separate pages for different languages, it is locale-adaptive.
We have the lang HTML attribute, HREFLangs and WordPress locale working just fine, it is just the Canonical URL generated by The SEO Framework left before we can set live for international SEO purposes.
We have two options
1 – We completely disable The SEO Framework’s generation of canonical URLS site-wide, and handle this ourselves (probably easier for us)
2 – We use a filter to alter the Canonical URL generated by The SEO Framework.
Can you please advise:
For #1, how do we disable just canonical URL generation site-wide?
For #2, are there any hooks that we can use to modify the canonical URL generated by your plugin? I looked through the docs but couldn’t find anything.
- The topic ‘Programmatically alter Canonical URLS’ is closed to new replies.