Issue
Our DXP site has English (United Kingdom) as its default language. For the Liferay sitemap, shouldn't it be expected to see the "en-GB" value associated with the hreflang attribute as per this example?
<url>
<loc>http://localhost:8080/page1</loc>
<lastmod>2021-09-26T06:6:30+00:00</lastmod>
<changefreq>daily</changefreq>
<xhtml:link href="http://localhost:8080/zh/page1" hreflang="zh-CN" rel="alternate"/>
<xhtml:link href="http://localhost:8080/page1" hreflang="en-GB" rel="alternate"/>
<xhtml:link href="http://localhost:8080/in/page1" hreflang="in-ID" rel="alternate"/>
<xhtml:link href="http://localhost:8080/vi/page1" hreflang="vi-VN" rel="alternate"/>
<xhtml:link rel="alternate" hreflang="en-GB" href="http://localhost:8080/page1"/>
</url>
Environment
- DXP 7.3
Resolution
-
The configuration hreflang="x-default" is expected here as per below:
<url>
<loc>http://localhost:8080/page1</loc>
<lastmod>2021-09-26T06:6:30+00:00</lastmod>
<changefreq>daily</changefreq>
<xhtml:link href="http://localhost:8080/zh/page1" hreflang="zh-CN" rel="alternate"/>
<xhtml:link href="http://localhost:8080/page1" hreflang="en-GB" rel="alternate"/>
<xhtml:link href="http://localhost:8080/in/page1" hreflang="in-ID" rel="alternate"/>
<xhtml:link href="http://localhost:8080/vi/page1" hreflang="vi-VN" rel="alternate"/>
<xhtml:link rel="alternate" hreflang="x-default" href="http://localhost:8080/page1"/>
</url>
- "x-default" is a special language key for search engines. Additionally, the sitemap contains an alternative for the en-GB flag under the alternate URLs.
Additional Information
- Google Documentation: Introducing "x-default hreflang" for international landing pages
- Google Video: Expanding your site to more languages