Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Generating XML Sitemaps with HREFLANG Tags

Avatar

Level 1

Is there a solution for automatically generating XML sitemaps containing hreflang tags or available thru a partner/3rd party service?

12 Replies

Avatar

Level 10

Can you explain your use case in more detail please. Not sure what you want to accomplish.

Avatar

Administrator

Hi

I do not know if AEM have OOTB for this.

But if you need to add manually , then

    HrefLang tag that goes within the <head> section of the page source code.

    Few examples of how the hreflang tag would be implemented on the site/page:
        <link rel=”alternate” hreflang=”en-gb” href=”http://www.mysite.co.uk”/> //(for .co.uk sites)

        <link rel=”alternate” hreflang=”en-us” href=”http://us.mysite.com”>    // (Google US)

        <link rel=”alternate” hreflang=”en-au” href=”http://www.mysite.com/au/”>   //Google Australia:

For Free tools, please have a look at this article:-

Link:-http://www.acronym.com/bebrilliant/seo/hreflang-sitemaps-free-tool/

//he use of rel=”alternate” hreflang=”x” within XML Sitemaps w/ FREE TOOL

Link:- http://www.stateofdigital.com/hreflang-sitemap-tool/

//Hreflang Sitemap Tool for Multilanguage & Multinational Websites

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 1

This is a good manual solution I think he is looking for a more scalable solution. There is a need to reference other pages that are equivelent, but in a different language/geo. I, too, am looking for a dynamically created hreflang tag on page and in an XML file

Avatar

Level 1

SEO requirements for Hreflang make this an important use case, and I hope Adobe Experience team looks at this.
To augment what Jeff wrote, HTML hreflang is a challenge to do sitewide (not to mention it's additional html on a page)
This is a quick guide about how to build an XML sitemap with hreflang tags, but this is not specific to a CMS, and AEM doesn't appear to have documentation on this:  https://ahrefs.com/blog/hreflang-tags/

Avatar

Level 7

I didn't got your question correctly?

Do you want to generate seperate sitemap.xml based on locale that hreflang detects?

Or just to all all locale url to sitemap.xml?

By default sitemap that is generated by aem consist of all the pages that are activated. If you want to customize it then you need to override OOTB sitemap component and get the hreflang from the locale browser and then generate sitemap.

Avatar

Level 3
                 It is and OOTB sitemap feature? Not the ACS one.

Avatar

Level 3
  There is an OOTB sitemap feature? ***

Avatar

Former Community Member

Possibly worth noting that A1 Sitemap Generator can crawl multi-language websites. When building the XML sitemap, it will try to determine which pages are language variations and automatically include hreflang information in the XML sitemap file as well.

Avatar

Level 1

Hi @jason_lax ,

 

Did you found any solution for the issue you were facing to automatic generate hreflang tags through the XML sitemap?

Avatar

Level 2

Was this issue solved? Is there any solution?

Avatar

Employee

Went through lot of forums/articles for a better/scalable solution. Sitemap generator works all fine in 6.5.11+ and CS instances. However, few customers prefer on the page href lang generation to sitemap.xml.

 

Proposed Solution:

For the href lang generation in the view-source of a page, I tried using this API and it works like a charm! In the process of assessing the performance issues, esp. when the page is loading for the first time, subsequent requests are cached anyways.  

https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/com/adobe/a...

Regardless of the MSM setup,  PageTreeSitemapGenerator pulls all the alternate language links. Only prerequisite is to have unique jcr:language correctly populated in the language roots.

 

something like this in your Model/OSGI service shall work  before you iterate through the map in HTL. 

 

@OSGiService
private PageTreeSitemapGenerator pageTreeSitemapGenerator;
alternateLanguageLinks = pageTreeSitemapGenerator.getAlternateLanguageLinks(currentPage);

 

Avatar

Level 2

Is there any way to include the link " name " authored in Spanish or Portuguese to get included in the hreflang? 

 

Because the same site with the same name in the URL is only collected from the sitemap generator and displayed in the alternate languages of hreflang and leaves the sites name which is authored in a different language with the same English alphabets.