Managing Site URLs

Configuring XML Sitemaps

Liferay DXP 2024.Q2+/Portal GA120+

XML sitemaps are XML-formatted documents listing the URLs of a website along with additional metadata (e.g. last update, change frequency, and importance relative to other URLs in the site). They streamline the process for search engine crawlers, enhancing their ability to uncover and index website content effectively.

Tip

You can view your XML sitemap by accessing http://your-site/sitemap.xml.

With Liferay, you can configure your XML sitemap to include/exclude sites and URLs from the sitemap.

Configure your XML sitemap.

To configure your XML sitemap,

  1. Open the Global Menu (Global Menu), navigate to Control Panel, and open Instance Settings.

  2. Select SEO under Platform and click XML Sitemap on the left.

  3. Click Select to include sites from your sitemap.

    You can also include/exclude child sites in the XML sitemap. When selecting a site, the number of child sites is shown below the site’s name. Click on it to see the child sites and select them.

    Include/exclude child sites.

    To exclude a site from your sitemap, click Remove New Site (Remove New Site icon) next to the added site.

    Note

    The XML sitemap only includes sites that don’t use virtual hosts.

  4. Liferay DXP 2025.Q4 Select whether to include object entry and CMS content structure URLs in the XML sitemap.

    Click Select to choose the object definitions and structures to include. Only published content that has a display page template and a publicly accessible URL appears in the sitemap.

    Note

    When an object definition or content structure is added to this list, search engines are notified that its related entry URLs are available for crawling.

    To remove an item from the sitemap, click Remove (Remove icon) next to the item.

  5. Select whether to include page (e.g., widget, content, panel, collection, and embedded) URLs in the XML sitemap.

    You can add a page to the sitemap through the page’s configuration. Read Page Settings UI Reference to learn more.

  6. Select whether to include web content URLs in the XML sitemap.

  7. Select whether to include category URLs in the XML sitemap.

Including Liferay CMS Content from Connected Spaces

Liferay DXP 2026.Q4+

A site’s XML sitemap can include content from the Liferay CMS spaces connected to it.

When you configure the XML sitemap, you must select the Liferay CMS content types to include, like any other structure. Four built-in types are eligible: Basic Document, Basic Web Content, Blog, and External Video. An asset appears only when it meets these conditions:

  1. The space is connected to the site in Liferay CMS. The XML Sitemap configuration can’t add spaces. See Connecting a Space to a Site.

  2. You’ve selected the content type in the XML Sitemap configuration.

  3. The content type has a default display page template that isn’t excluded from the sitemap. If the template’s page is unpublished or has a custom canonical URL or a noindex/nofollow robots value, every asset of that type is excluded.

  4. The Guest role can view the asset. Crawlers request the sitemap anonymously, so the sitemap omits any asset that role can’t view. See Managing Permissions in the Content Management System.

Important

Some Liferay CMS content types have names similar to legacy types, for example Basic Web Content and Web Content Article. Ensure you’ve selected the correct structure. Under the Group by Asset Type index mode, Liferay writes Liferay CMS assets to /sitemap-object-entries.xml and web content to /sitemap-web-content.xml.

Liferay CMS content belongs to a space, so each asset’s URL includes the space’s friendly URL, even though the site’s display page template renders the asset. See Configuring Content URLs for how each part of the URL is set.

To confirm an asset appears, go to http://your-site/sitemap.xml and look for its URL. Under the Group by Asset Type index mode, look in /sitemap-object-entries.xml instead.

Caching the XML Sitemap

Liferay DXP 2026.Q3+

Sitemap caching serves a pre-built XML sitemap instead of generating it dynamically on every request. Every hour, Liferay regenerates only the sitemaps with modified content (added, updated, or deleted pages, web content articles, categories, or object entries). Between regenerations, the cached sitemap reflects the content state of its last regeneration. This hourly interval is fixed and can’t be modified.

Because these caching settings apply instance-wide, ensure your target sites are included in the sitemap configuration before proceeding.

Caching requires XML Sitemap Index Enabled (selected by default). Both index modes split a sitemap past 50,000 URLs or 50 MB into numbered files. A Group by Page Layout index lists at most 50,000 of these files.

Important

In Liferay DXP 2026.Q3, the XML Sitemap Generation Mode section appears only after you save the Group by Asset Type index mode. Scheduled Cached regenerates changed sitemaps on a schedule you set. Group by Page Layout drops the oldest URLs past either limit.

To access these settings, open the Global Menu (Global Menu) and go to Control Panel → Instance Settings → SEO → XML Sitemap.

The XML Sitemap page shows Scheduled Cached selected in the XML Sitemap Generation Mode section with the Last updated and Next Scheduled lines.

  1. If XML Sitemap Index Enabled is cleared, select it and click Save. The XML Sitemap Generation Mode section appears only while the index is enabled.

  2. (Optional) In the XML Sitemap Index Mode drop-down, select Group by Page Layout or Group by Asset Type. The default Group by Page Layout gives each page its own sitemap file. Group by Asset Type gives each asset type its own file. Either mode supports caching.

  3. In the XML Sitemap Generation Mode section, select Scheduled Cached. A Save and Generate button appears.

    To keep generating sitemaps on each request, leave On-Demand selected and click Save.

  4. Click Save. Saving generates the cache when none exists yet or when the index mode changes. Otherwise it only stores the settings. Click Save and Generate instead to regenerate immediately, for example after changing the included sites or content.

    Last updated and Next Scheduled then appear at the top of the XML Sitemap settings. Last updated shows the last regeneration time or a dash before the first. Next Scheduled shows when the next regeneration is due, or a dash when nothing is waiting. During a regeneration, Next Scheduled shows Generating now…

    The cache is up to date when Last updated shows a time after your save and Next Scheduled shows a dash.

To stop caching, select On-Demand or clear XML Sitemap Index Enabled, and click Save. Saving discards the cached sitemaps. Saving a different index mode while Scheduled Cached is selected discards the cache and regenerates it for the new mode.

Excluding Redirected URLs from the Sitemap

Liferay DXP 2026.Q3+

Liferay automatically excludes URLs that match an active Alias Redirect or Pattern Redirect in the site’s Redirection application from the generated XML sitemap. This exclusion is always on.

Liferay drops the redirected source URL rather than replacing it with the destination, so crawlers aren’t sent through a redirect hop. The exclusion covers every URL type the sitemap can include: pages, web content, categories, object entries, and Commerce product definitions.

Only URLs matched by an active redirect are excluded. URLs that return a 404, 410, or 5xx response are unaffected. If every candidate URL for a site is excluded, Liferay still generates a valid, empty XML sitemap rather than a blank response.