Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-97078

Manage canonical URLs for localized content at system level

    Details

    • Type: Story
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: 7.2.X, Master
    • Component/s: WCM > SEO
    • Labels:

      Description

      Business goal

      Improve SEO for multilingual sites. Currently, Liferay's ability to rank pages in Google for any region besides NA is currently limited because it is not handling canonical URLs in the most optimal way (See https://www.portent.com/blog/seo/implement-hreflang-canonical-tags-correctly.htm for a description of a recommended way as of today)

      As a marketer

      I want  Liferay to produce optimized canonical URLs and href-lang tags for multilingual content and be able to configure how it behaves

      so that search engines identify correctly my localized content

      Acceptance criteria

       

      Given a site with multiple languages supported

      When an admin checks system settings

      Then they should be able to set that the localized pages use the URL to itself as canonical URL or use the default language URL.

        

      Given a localized page with the following URL: localhost:8080/es/web/guest/my-localized-page

      When the setting for using the localized URL as canonical is set to true

      Then Liferay should set in head the following metatag: <link data-senna-track="temporary" href="http://localhost:8080/es/my-localized-page" rel="canonical" /> 

      Context

      issue detected: https://issues.liferay.com/browse/PTR-967

      Related feature requests:

      https://issues.liferay.com/browse/LPS-97037

      https://issues.liferay.com/browse/LPS-97038

       

      current behavior:

      In a site, each page has the same meta tags:

      <link data-senna-track="temporary" href="http://localhost:8080/my-localized-page" rel="canonical" />

      <link data-senna-track="temporary" href="http://localhost:8080/zh/my-localized-page" hreflang="zh-CN" rel="alternate" />

      <link data-senna-track="temporary" href="http://localhost:8080/es/my-localized-page" hreflang="es-ES" rel="alternate" />

       

      But it shouldn't in case we are visiting a translated page.

       

      Expected behavior:

      if the following page exists: localhost:8080/es/web/guest/my-localized-page, then it should be possible to set as canonical URL a reference to itself:

       

      <link data-senna-track="temporary" href="http://localhost:8080/es/my-localized-page" rel="canonical" />

      <link data-senna-track="temporary" href="http://localhost:8080/zh/my-localized-page" hreflang="zh-CN" rel="alternate" />

      <link data-senna-track="temporary" href="http://localhost:8080/es/my-localized-page" hreflang="es-ES" rel="alternate" />

       

      Design

      Figma

       

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.2.X
                  Master