Skip to content

Sitemap: tell search engines which pages your site has

Describes PhoenixKit 3.5.0.

PhoenixKit builds an XML sitemap of your site’s public pages at /sitemap.xml, so search engines can find them. It collects the addresses from your routes and from modules that publish content, and rebuilds the file on a schedule or when you ask.

Where to find it

Settings → Sitemap (/admin/settings/sitemap). You need the Sitemap permission, or the Owner or Admin role. Sitemap is a module: turn it on with the switch at the top right of the page, or on the Modules page, whose Sitemap card has Configure and a link to the file.

Every address in the sitemap is built from the site’s address, Site Address (URL) on Settings → General. Without it, regenerating fails with Please configure Base URL before generating.

The Sitemap settings in PhoenixKit: 55 URLs, last generated time, Regenerate All, and Router Discovery with its sources Routes, Static, Publishing, Entities, Posts and Shop The Sitemap settings in PhoenixKit: 55 URLs, last generated time, Regenerate All, and Router Discovery with its sources Routes, Static, Publishing, Entities, Posts and Shop

The sitemap page: what's in /sitemap.xml and where it comes from.

The numbers at the top

  • Total URLs and Sitemap Files: what the last generation produced.
  • Last Generated: when.
  • Actions: Regenerate All queues a new build. The stats update by themselves when it is done.

Where the addresses come from

Router Discovery decides how the sitemap is built:

  • On: PhoenixKit scans all routes and builds one flat /sitemap.xml with every address from every source (routes, static pages, publishing, entities, posts, shop).
  • Off: each source makes its own file, and /sitemap.xml is an index pointing to them. The Module Sitemaps card then lists the sources with the number of addresses and a link to its file (View sitemap):
    • Static Pages: the homepage and custom static addresses.
    • Publishing: blog groups and published posts, with Split by blog group for a file per group.
    • Entities: dynamic content types, a file per type.
    • Posts: public posts from the Posts module. This one has no switch of its own.
    • Shop: products, categories and the catalog.

Each source except Posts has a switch. A source whose module is not on is marked module off.

Auth Pages: Login and Logout are always excluded. Registration can be included in the static sitemap with its switch.

When the site has several languages, each page is listed per language, with the other language versions linked to it.

Configuration

  • Site URL: the address addresses are built from, shown read-only. The pencil (Edit in Settings) opens Settings → General.
  • Browser Display Styling: styles the XML so it reads well when opened in a browser.
  • Display Style: Table (Clean table layout) or Minimal (Simple list), used while browser styling is on.

Scheduled Generation

The Scheduled Generation switch rebuilds the sitemap regularly. Regenerate every: 1 hour, 6 hours, 12 hours, 24 hours, 48 hours or Weekly.

Quick Actions

  • Preview Sitemap Source: shows the XML of /sitemap.xml in a window, with Open in Browser.
  • Clear All Sitemaps: deletes the generated files and starts a new build.

Below them, Generated sitemap files: links sitemap.xml and, without Router Discovery, every source file. The sitemap is served at the site root as well as under the PhoenixKit prefix. A priv/static/sitemap.xml file in your app would be served instead of this one. Crawler settings has the robots.txt line that points crawlers here.

Advanced

Advanced holds low-level settings most sites never need:

  • Router Discovery: Exclude Patterns: one regular expression per line; matching routes are left out. They are added to built-in defaults that always apply. Save Exclude Patterns.
  • Protected Pipelines: one pipeline name per line, added to the built-in defaults. Save Protected Pipelines.
  • Custom URLs: a JSON list of extra static addresses (path, priority, changefreq, title, category). Save Custom URLs.
  • Static Routes: a JSON list of route entries. Saving it replaces the built-in defaults entirely: an empty list removes the homepage entry too. Save Static Routes.

Installed sources can add settings of their own to the page.

What it doesn’t do

  • It does not tell search engines about the sitemap. Point them to it in robots.txt (see the Crawlers guide) or in each search engine’s own console.
  • The sign-in and sign-out pages are always left out.
  • With the module off, /sitemap.xml answers “Sitemap not available”.