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?
<sitemapindex> <sitemap> <loc>http://localhost:8080/sitemap.xml?p_l_id=2&layoutUuid=056d0228-b82c-3a0f-800d-942f656b3cec&groupId=20122&privateLayout=false</loc> </sitemap> </sitemapindex>
Environment
- Liferay DXP 7.0 - 7.4
Resolution
- 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