Drupal XML sitemap
Install Simple XML sitemap on Drupal 10.3 or 11, include the right entity bundles, generate the file, and fix host or multilingual issues.
For Drupal 10.3 or 11, install Simple XML sitemap 4.2 with composer require 'drupal/simple_sitemap:^4.2'. Configure it at /admin/config/search/simplesitemap, enable only the public entity types and bundles you want discovered, generate the sitemap, then inspect /sitemap.xml. Confirm its base URL is the canonical production host and submit it in Search Console; sitemap inclusion does not guarantee indexing.
Where does your site stand?
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
- Free audit in 60 seconds
- Fixes drafted for your review
- ChatGPT, Perplexity, Gemini and AI Overviews tracked
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
- Re-check after big site changes
- Keep this page for reference
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
- Follow the steps below
- Top-traffic pages first
- Check again in a month
Install a release compatible with Drupal core
core_version_requirement: ^10.3 || ^11, so it won't install on Drupal 10.0 to 10.2. Releases 4.2.1 and 4.2.2 list ^10.2 || ^11, and 4.1.9 lists ^9.3 || ^10. Check the release page before installing on an older core.composer require 'drupal/simple_sitemap:^4.2'
drush en simple_sitemap -y
drush simple-sitemap:generate- 01
Add the module with Composer
From the Drupal project root, run
composer require 'drupal/simple_sitemap:^4.2'. Keep the code and lockfile together and deploy through your site's normal release process. - 02
Enable the module
Enable Simple XML sitemap through Extend or Drush. If upgrading the module, run pending database updates with the supported Drupal update process before generating new files.
- 03
Open sitemap configuration
Manage sitemaps at
/admin/config/search/simplesitemapand module-wide settings at/admin/config/search/simplesitemap/settings. Module permissions are at/admin/people/permissions/module/simple_sitemap; restrict them to the appropriate role. - 04
Generate and inspect the default sitemap
The module's default sitemap is available at
/sitemap.xml. Generate it with the manual generation option on the sitemaps screen, or withdrush simple-sitemap:generate(aliasssg), then open the public file and inspect its source. With cron generation on, it also regenerates on the interval set in Sitemap generation interval.
Choose which Drupal content belongs in the sitemap
/admin/config/search/simplesitemap/entities, enable the entity types you want, and use Configure to set indexation per sitemap. Installation alone does not cover nodes, taxonomy terms, products, or custom content.- 1
Enable relevant entity types
In the entity settings, choose content entities such as nodes, taxonomy terms, and commerce products that have public, useful pages.
- 2
Configure bundles deliberately
For each selected entity type, choose which bundles and languages are indexable. Exclude drafts, private entities, empty archives, duplicate views, and pages marked noindex.
- 3
Review entity-level exceptions
Where a page should not be listed, change its setting on the bundle's configuration page (for example
/admin/structure/types/manage/[content type]) or override it on the entity's edit form (for example/node/1/edit). Only links accessible to anonymous users are included. Confirm translated content and publication state for every locale. - 4
Add custom links only when needed
Use custom links for public routes that are not represented by enabled entities. Avoid manually listing URLs that a generator already includes.
| Page family | Include when | Exclude when |
|---|---|---|
| Articles and landing pages | Published page gives a complete answer or serves a clear business purpose. | Draft, private, duplicate, or intentionally noindex. |
| Taxonomy and category terms | The archive has distinct inventory or editorial context and can help visitors choose. | Empty term, thin near-duplicate archive, or internal classification only. |
| Commerce products | Product is public and has useful, current details. | Private, discontinued without replacement, or duplicate variant URL. |
| Views or custom routes | The route is a canonical search landing page with stable content. | Search results, filter combinations, or parameter variations with no unique value. |
Set the right public base URL and language behavior
/admin/config/search/simplesitemap/settings) exists because, in its words, on some hosting providers it is impossible to pass parameters to cron to tell Drupal which URL to bootstrap with. Fill it in with the canonical production origin when generation runs from cron or the command line and the links come out wrong; the form rejects an invalid URL and strips a trailing slash.- 01Check a generated
<loc>for HTTPS, the canonical hostname, and the expected language prefix. - 02For multilingual sites, decide whether each language variant should appear and verify the generated hreflang relationships against live canonical pages.
- 03The module can hold several sitemaps. The sitemap index is disabled by default; to list all sitemaps at
/sitemap.xml, enable it, move it to the end of the sitemap list, and set it as the default sitemap on the settings page. - 04Maximum links in a sitemap defaults to 2000 in the module's install config. When more links are generated, the module creates a sitemap index and splits them into sub-sitemaps. Google allows 50MB (uncompressed) or 50,000 URLs per sitemap.
- 05Skip non-existent translations is on by default: entity links are generated only for languages the entity has been translated to. The settings page also has Remove hreflang markup in HTML; its help text says Google recommends hreflang in either the HTML or the sitemap, not both.
- 06Regenerate after content or configuration changes and confirm that the new file replaces stale URLs without making the public endpoint unavailable during generation.
For very large content sets, generation can take time. Each sitemap is published as soon as all of its links are generated, and the previous version stays available meanwhile. The README documents a performance script (drush scr --uri http://example.com modules/simple_sitemap/tests/scripts/performance_test.php) and the settings Entities per queue item and Sitemap generation max duration.
Validate and submit the sitemap
- 1
Open the public XML
Request
/sitemap.xmlwithout authentication. Check the response status, XML syntax, canonical host, and whether the expected child sitemaps or page URLs are present. - 2
Sample listed URLs
Choose examples from each included bundle and language. Confirm they return successful pages, use their preferred canonical, and are not blocked or marked noindex.
- 3
Submit under the matching Search Console property
Submit the sitemap URL in Search Console's Sitemaps report for the canonical host, as Google's sitemap guide describes. Google calls submission a hint: it doesn't guarantee that Google will download the sitemap or use it for crawling. Then inspect important URLs individually.
- 4
Fix the source setting
If a URL is missing, review bundle and entity inclusion. If a URL is listed but not indexed, inspect its page-level canonical, crawl access, and content usefulness instead of repeatedly resubmitting the file.
For broader guidance, read Google Search Console sitemap submission and the XML sitemap overview.
Every fact, linked and dated.
drupal.org
drupalcode.org
google.com
- 01Drupal.org release history feed (Simple XML sitemap)updates.drupal.org · checked 2026-10-24
- 02Simple XML sitemap README | Drupal.orggit.drupalcode.org · checked 2026-10-24
- 03Simple XML sitemap settings form and defaults | Drupal.orggit.drupalcode.org · checked 2026-10-24
- 04Build and submit a sitemap | Google Search Centraldevelopers.google.com · checked 2026-10-24
Asked a lot.
4 questions people ask next, answered from the sources on this page.
01How do I create a sitemap in Drupal 10 or 11?
Install Simple XML sitemap 4.2 with Composer, enable it, configure entity types and bundles at /admin/config/search/simplesitemap, generate the file, then inspect /sitemap.xml.
02Why does my Drupal sitemap only contain the homepage?
Simple XML sitemap requires you to enable entity types and bundles for inclusion. Check its entity settings and whether the relevant content is published and indexable.
03Why does my Drupal sitemap use the wrong domain?
Generation from cron or the command line has no browser request to take the host from. Set Default base URL in the module's settings to the production origin and regenerate.
04Does adding a URL to Drupal's sitemap make Google index it?
No. A sitemap helps Google discover URLs; Google says submitting one is a hint and does not guarantee crawling. Indexing is decided separately.
Tools point. Agencies advise. This one ships.
Run the free audit, then approve the fixes. Every change can be undone.
- 46 fixes shipped without a ticket Brightpipe
- 0→7 ChatGPT citations in six weeks Paylane