hreflang

Search engines use <link rel="alternate" hreflang="x" /> tags to serve the correct language or regional URL in search results.

Alternate hreflang is a simple module that automatically adds these tags to your pages. It has no dependencies, but works well with Entity Translation.

More info about hreflang can be found at the article Use hreflang for language and regional URLs.

A few days after installing this module, you should see a message reading "Currently, your site has no hreflang tag errors" at Google Webmaster Tools.

Take a look at the source code of this site to see the module in action.

Drupal 8

In Drupal 8, the core Content Translation module adds hreflang tags only to translated entity pages. This module, on the other hand, adds hreflang tags to all pages.

If for some reason you'd like to modify the hreflang tags on a page, you can do so by implementing hook_language_switch_links_alter() or hook_page_attachments_alter() in a site-specific custom module.

Drupal 7

If for some reason you'd like to modify the hreflang tags on a page, you can do so by implementing hook_language_switch_links_alter() or hook_html_head_alter() in a site-specific custom module.

Supporting organizations: 

Project information

Downloads