Configuring Hreflang Meta Data

Hreflang tags are HTML attributes used to identify the language and geographic region targeted by alternative versions of a page. In some cases, these attributes can help search engines serve the correct version of a page to users and contribute to SEO. By default, Liferay DXP populates page hreflang meta data with all available languages in the site.

Beginning with Liferay 7.4+, you can configure this behavior to generate hreflang meta data only for languages with translated content in a page. This can be configured at both the instance and site levels.

When hreflangs are limited in this way, Liferay’s behavior can vary depending on page type:

  • Widget Pages: Languages used to translate a widget page’s name are added to the hreflang tags.

  • Content Pages/Display Page Templates: Languages used to translate a page fragment are added to the hreflang tags.

Configuring Hreflang Behavior at the Instance Level

  1. Open the Global Menu (Global Menu), click the Control Panel tab, and go to Instance SettingsPagesSEO (Virtual Instance Scope).

  2. Check/Uncheck Enable Only Translated Hreflangs.

    Enable or disable the hreflang behavior for all instance Pages.

  3. Click Save.

When enabled, hreflang metadata is only generated for languages with translated content in a page. When disabled, page hreflang tags are populated with all available languages in a site.

Configuring Hreflang Behavior for All Sites in an Instance

  1. Open the Global Menu (Global Menu), click the Control Panel tab, and go to Instance SettingsPagesSEO (Site Scope).

  2. Check/Uncheck Enable Only Translated Hreflangs.

    Enable or disable the hreflang behavior for all sites.

  3. Click Save.

When enabled, hreflang meta data is only generated for languages with translated content in a Page. When disabled, page hreflang tags are populated with all available languages in a site.

Note

By default, site scope instance settings are applied to all instance sites. However, individual site configurations override configurations in the Global Menu. To restore the default behavior and synchronize changes between both menus, you must restore the individual site’s settings to default.

Configuring Hreflang Behavior for an Individual Site

  1. Navigate to the desired Site.

  2. Open the Site Menu (Site Menu), expand Configuration, and go to Site SettingPagesSEO.

  3. Check/Uncheck Enable Only Translated Hreflangs.

    This configuration only affects pages in the current site.

    Enable or disable the hreflang behavior for a site's pages.

  4. Click Save.

When enabled, hreflang meta data is only generated for languages with translated content in a page. This configuration affects all pages in the current site and overrides the instance configurations settings.

Note

By default, individual site settings are inherited from site scope instance settings. However, individual site configurations override this behavior. To restore the default behavior and synchronize changes between both menus, you must restore the individual site’s settings to default.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy