Hreflang

Adds support for adding SEO-friendly hreflang html tags. From Wikipedia:

Hreflang specifies the language and optional geographic restrictions for a document. Hreflang is interpreted by search engines and can be used by webmasters to clarify the lingual and geographical targeting of a website.

After setting up which blogs supply which languages, and optionally which blog provides the x-default language, the hreflang links will be added automatically on all of the specified blogs.

Screenshots

Notes

The plugin does some basic checks when inserting the languages:

  • If the shown page is a post, and is broadcasted + linked, it fetches the languages from the linked siblings.
  • If the shown page is a post, it checks to see whether a post with the exact same slug exists on each setup blog.
  • If the shown page is an archive, the taxonomy is checked for existence on each setup blog.
  • If the page is the front page, it is assumed that the other blogs also have a front page. :)

For developers, there is an action you can hook into to fine-tune the hreflang tags before display. See this snippet on how to modify the hreflang links dynamically.

Where to buy

This add-on is a part of the following packs:

Comments

  1. Hi, one short question about this addon.

    We have a multisite with a site for each language. As an Example, we have an “About us” Page on all sites. And it would be great that for all these sites the hreflang could be created automatically.

    Would it also work if we change the permalink in a specific site? so that all other languages stay connected?

    1. hreflang will automatically create the links as long as the post is linked to other posts.

      You can change whatever you want with each post (including the permalink) as long as the linking remains.

      Also, if you are unable to keep the linking, there is an action you can hook into to programmatically add or remove hreflang links.

  2. I’m not sure how this addon is supposed to be used.

    If I write a post in (say) English, and then broadcast that post to another site, the post will still be in English. If I have said (see screenshot 2) that the recipient site is in German, then this addon will insert a HREFLANG tag that says my English post is also available on the other site, and that it is available in German. However, if you then follow that link you’ll obviously end up with at the same English language post. So, the inserted HREFLANG is wrong. How is this supposed to work?

    The reason why I’m asking is that I have a multisite setup where some of the sites are using WPML. I was hoping to just broadcast all the translated posts to the other-language sites, and have the HREFLANG plugin sort out the appropriate HREFLANG tags. It seems that this won’t work (no support for WPML in this addon), but it made me wonder how this is supposed to work at all? Thanks for helping me out here.

    1. From what I understand from users of Hreflang and WPML / Polylang, the network has one main site with all the languages, and various sites with only one language.

      They broadcast german to the German blog, French to the French blog, etc. The German blog has the hreflang DE-DE and the French has FR-FR. When displaying the single post, the Hreflang add-on will show tags for the main site (default), French as FRFR and German as DEDE.

      Something like that, at least. There can only be one blog for a specific language + region combination, according to the hreflang tag rules.

  3. How would this work when a post’s slug is translated to a different language?

    So far I haven’t even been able to Broadcast a page from an English site to a French site because the slugs for a custom post type are different (ex: English – blog vs French – blogue)

    1. As long as the posts are linked, there should be no problem getting the equivalent siblings.

      If you need more help, I suggest e-mailing me a debug text of the post in question. That will tell me what Broadcast is doing.

Leave a Reply to Martin Cancel reply

Your email address will not be published. Required fields are marked *