Sitemap | Community
Skip to main content
Level 2
September 4, 2024
Solved

Sitemap

  • September 4, 2024
  • 2 replies
  • 1477 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 2
September 4, 2024

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>
EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 4, 2024

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-for-aem-6-5-11-and-aemaacs/ 

 

[1]. PageTree Sitemap configuration

Hope this helps

 

Esteban Bustamante
Level 2
September 5, 2024

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>