Legacy Knowledge Base
Published Jul. 2, 2025

Canonical tags are not language specific

Written By

Tímea Bihari

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  1. I start Liferay
  2. I create a new site with a new page
  3. I sign out
  4. I navigate to the newly created page and inspect the HTML: <link href="http://localhost:8080/sitename" rel="canonical">
  5. I switch to another language (eg: German) by navigating to http://localhost:8080/de/sitename
  6. I inspect the HTML again

Expected Result:
The output should read as follows: <link href="http://localhost:8080/de/sitename" rel="canonical">

Actual Result:
The output reads as follows: <link href="http://localhost:8080/sitename" rel="canonical">

Environment

  • Liferay 6.2
  • Liferay DXP 7.0
  • Liferay DXP 7.1

Resolution

In the affected Liferay versions, the canonical tag is always set to the default language URL.

The behavior is based on the assumption that default language for a site means that all content will normally be added for this language and non-default language pages have a reasonable probability of containing duplicate, untranslated content.

In situations where the sites are translated into multiple languages, being able to index the different versions is a reasonable expectation and Liferay has implemented this as a new feature in DXP 7.2 SP1.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base