Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Sitemap

Avatar

Level 2

How to create the sitemap for aem sites using org-apache-sling-sitemap api in which we can see domain name and last modified date in sitemap.xml file

6 Replies

Avatar

Level 2

I have gone through both documents but my requirement is bit different, i want url with domain in sitemap file instead of starting with content path 
Ex:

<url>
<lastmod>2024-05-10</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<lastmod>2024-04-30</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>

Avatar

Level 2

Hi @MukeshYadav_ 
I have gone through the documents which are helpful but the challenge, I am facing the challenge on logic that how can we get the changefrequency and priority inside the sitemap.xml  

Avatar

Community Advisor

Hi, 

 

If you are using the Sling Sitemap feature, you must configure your Externalizer settings. To add the lastModified tag to your sitemap, you can simply enable the option in the Adobe AEM SEO - Page Tree Sitemap Generator configuration[1], which is the default sitemap implementation for Sling Sitemap. However, this out-of-the-box implementation only supports alternate languages and lastModified tags. If you need additional tags, such as priority or changefreq, you will need to create your own sitemap implementation.

Here is an example of how to add the fields you are looking for: https://aemsimplifiedbynikhil.wordpress.com/2021/12/01/extending-the-apache-sling-sitemap-generator-... 

 

[1]. PageTree Sitemap configuration

EstebanBustamante_0-1725459986142.png

Hope this helps

 



Esteban Bustamante

Hi @EstebanBustamante 
I have gone through the documents which are helpful but the challenge, I am facing is 
I have multi brands sites on same domain,
Like i have www.ABC.edu and www.XYZ.edu
Now i want the sitemap for www.ABC.edu will be like

<lastmod>2024-05-10</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<lastmod>2024-04-30</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>
 

And for www.XYZ.edu it will be like
<lastmod>2024-05-10</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<lastmod>2024-04-30</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>