Issue
The default Sitemap format in Liferay DXP is "Sitemap Index". For example, accessing http://localhost:8080/sitemap.xml will return the following content. How do I change the default format to use Sitemap instead?
http://localhost:8080/sitemap.xml?p_l_id=2&layoutUuid=056d0228-b82c-3a0f-800d-942f656b3cec&groupId=20122&privateLayout=false
Environment
- Liferay DXP 7.0 - 7.4
- Quarterly Releases
Resolution
- Starting with version 2024.Q4 and later, this setting can be modified under Control Panel > Instance Settings > SEO > XML Sitemap.
- For older versions, add the following property to portal-ext.properties and restart the server.
# Set this property to false to create the sitemap.xml file based in a
# layout set. By default, a sitemap index is created, which provides links
# to multiple sitemap files rather than one large file containing all the
# urlsets. This requires less bandwidth and improves performance. See
# https://www.sitemaps.org/protocol.html for more information.
#
# Env: LIFERAY_XML_PERIOD_SITEMAP_PERIOD_INDEX_PERIOD_ENABLED
#
xml.sitemap.index.enabled=false
Additional Information
- Please note that both Sitemap Index and Sitemap are standard formats. Please refer to the following links for more information.
- https://support.google.com/webmasters/answer/75712?hl=en
- https://www.sitemaps.org/protocol.html#validating
- LPD-35765 - Add instance setting to enable or disable XML sitemap index