Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Hreflang

11,991 sites Security covered Drupal 11 · not 10
View on drupal.org

This module automatically adds hreflang tags to your Drupal site's pages, helping search engines serve the correct language or regional URL in search results. It works with your site's enabled languages and the language switch links provided by Drupal core, and can be configured to work alongside or override the core Content Translation module.

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

Hreflang is a simple module that automatically adds these tags to your pages, based on your site's enabled languages and the language switch links provided by core.

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.

The core Content Translation module adds hreflang tags only on content entity pages. This module, on the other hand, adds hreflang tags to all pages, and can be configured to defer to Content Translation module on content entity 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

This module has no dependencies, but works well with Entity Translation module. 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.

Credits:

This module is developed and maintained by mfb. You can support development by contributing or sponsoring.

Alternatives and similar modules:

The Metatag: Hreflang module allows tokens to be entered to set the hreflang tags, but doesn't do that (or anything) automatically. This module adds the hreflang tags automatically.

Ports:

This project has been ported to Backdrop CMS and Drupal 6 LTS.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Dec 2024
Latest release
2 weeks ago
Releases (12 mo)
3 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.0 Stable 11 Aug 17, 2026
2.x-dev Dev 11 Jul 19, 2026
8.x-1.16 Stable 8–11 Sep 16, 2025
8.x-1.15 Stable 8–11 Dec 8, 2024