automattic / msm-sitemap
Comprehensive sitemaps for your WordPress.com VIP site.
Package info
github.com/Automattic/msm-sitemap
Type:wordpress-plugin
pkg:composer/automattic/msm-sitemap
Requires
- php: >=7.4
- composer/installers: ^1.0 || ^2.0
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 2.x-dev
- 1.6.0
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.5-beta
- 1.4.2
- 1.4.1
- 1.4
- 1.3
- 1.2.1
- 1.2
- 1.1
- 1.0
- dev-main
- dev-GaryJones/rename-msm-sitemap
- dev-feature/coverage-infrastructure
- dev-proposal-hreflang-support
- dev-cojennin/modify-sitemap-element-1
- dev-cojennin/modify-sitemap-element
- dev-add/activation-hooks
- dev-add/cache-improvement
- dev-remove/flot-submodule
- dev-image-schema-location
- dev-pr/105
- dev-kill/full-site-cron
- dev-add/image-support
- dev-fix/code-cleanup
- dev-fix/404
This package is auto-updated.
Last update: 2026-11-16 01:03:52 UTC
README
Stable tag: 1.6.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: sitemap, xml, seo, performance, multisite
Contributors: metro, automattic, alleyinteractive, makermedia, 10up, garyj
XML sitemaps for large WordPress sites, built in the background one day at a time and served from storage.
Description
MSM Sitemap is built for news sites and other publishers with a lot of content. Instead of generating a sitemap on every request, it builds one sitemap for each day that has content, stores it, and serves the stored copy. The sitemap index at /sitemap.xml lists every day.
- Fast to serve. Daily sitemaps are stored as finished XML, so a request does no sitemap work.
- Built in the background. Sitemaps are built a day at a time through WP-Cron or WP-CLI, so even sites with millions of posts don't time out.
- Kept up to date. Once automatic updates are on, a day's sitemap is rebuilt when a post on that day is published, edited, unpublished, re-dated, trashed or deleted.
- In your control. Nothing runs until you start it, and you can build sitemaps for a year, month or day at a time from the shell.
- Readable in a browser, with stylesheets you can change or turn off.
- Multisite compatible. Each site has its own sitemaps.
The Tools → Sitemap screen shows how many sitemaps and URLs there are, charts recent days, and lets you turn automatic updates on and off and start a full build. The wp msm-sitemap commands do all that and more from the shell.
MSM Sitemap replaces WordPress core's sitemaps at /wp-sitemap.xml while it's active.
Documentation
Guides for site owners and developers live in the docs/ directory on GitHub:
- Generating sitemaps: the first build, automatic updates, large sites and multisite
- Serving sitemaps: URLs, robots.txt, sites that aren't public, caching and limits
- WP-CLI commands
- Customizing MSM Sitemap and the full list of filters and actions
Installation
- Install and activate MSM Sitemap. On a multisite network, you can network-activate it.
- Build sitemaps for your existing content. On a large site, use WP-CLI:
wp msm-sitemap generate --all. Otherwise, go to Tools → Sitemap, choose Enable Automatic Updates, then Generate from all articles. - Turn on automatic updates, if you haven't already, so sitemaps follow your content: Tools → Sitemap → Enable Automatic Updates, or
wp msm-sitemap cron enable. - Submit
https://example.com/sitemap.xmlto search engines. It's also added to your site's robots.txt.
Nothing is built or scheduled until you do steps 2 and 3. Building every sitemap at once can put a heavy load on the database of a large site, so the plugin leaves the timing to you. See generating sitemaps for the details.
Sitemaps are only available on public sites, unless you enable them on a site that isn't public.
Frequently Asked Questions
Why is my sitemap empty, or why does /sitemap.xml return a 404?
An empty index means no sitemaps have been built yet: see the installation steps. A 404 usually means the rewrite rules haven't been rebuilt, which happens when the plugin is loaded from code rather than activated, or network-activated. Save Settings → Permalinks without changes, or run wp rewrite flush. If that doesn't help, check that the site is public. More on sitemap URLs.
Which content is included?
Published posts of the post post type, grouped by the day they were published. You can add pages and custom post types, use a different post status, and leave particular posts out.
Can I use it on a staging site, or a site that isn't public?
Yes, with a filter. By default, sitemaps are only built and served on sites that allow search engines to index them.
I publish more than 500 posts a day. Are they all included?
Not by default. Each daily sitemap holds up to 500 URLs, and posts beyond that are left out. You can raise the limit.
Does it replace WordPress core sitemaps?
Yes. WordPress's own sitemaps at /wp-sitemap.xml are turned off while MSM Sitemap is active. If another plugin also generates sitemaps, submit only one set to search engines.
Does it work on multisite?
Yes. Each site has its own sitemaps, and its own automatic updates setting, so turn updates on for each site, even when the plugin is network-activated.
How do I rebuild the sitemaps?
Run wp msm-sitemap generate --all, or choose Generate from all articles on Tools → Sitemap (automatic updates must be on). Rebuild after changing any filter that affects what goes into a sitemap.
How do I turn off the styling in the browser?
Add add_filter( 'msm_sitemap_include_xsl_reference', '__return_false' ); to a plugin or your theme's functions.php. Sitemaps are then served as plain XML. You can also restyle them.
Where are sitemaps stored?
Each daily sitemap is a post of the private msm_sitemap post type, with its XML in post meta. See how MSM Sitemap works.
Contributing
Bug reports and pull requests are welcome on GitHub. See the contributing guide to get started.
Support
- GitHub issues, for bug reports and feature requests.
- WordPress VIP Support, for WordPress VIP customers.
Credits
MSM Sitemap is a joint collaboration between Metro.co.uk, WordPress VIP, Alley Interactive, Maker Media, 10up, and others. Special thanks to all contributors.
Changelog
Every change is listed in CHANGELOG.md.
License
GPLv2 or later. See LICENSE for details.