How to use hreflang tags?


Yes, such tags are supposed to help users find search results in their own language. They are of course only meaningful if you have the same content in multiple languages. I’d expect multilingual plugins to handle this for you, but I’ve no direct experience so I could be wrong.

A list of the page’s URLs for each language goes in the <head> section so you could use the “wp_head” action to have code add the tags. I’m not sure how code would know which links to list for any given page. It would be specific to how you manage languages.

Google says hreflang tags should take the place of a canonical link for the page. If you do add hreflang tags you might want to remove the canonical action callback to fully comply.



Source link