NiroSitemap – No-Setup Dynamic XML Sitemap

Description

NiroSitemap is a no-setup, plug-and-play dynamic sitemap for WordPress. Activate it and your sitemap is live at /sitemap.xml. There is no settings screen, no wizard and nothing to configure.

No setup

You do not choose post types, set priorities or regenerate anything. NiroSitemap finds every public post type on your site, including ones added later by your theme or other plugins, and lists them for you.

Plug and play

The sitemap works the moment you activate the plugin. You do not need to save your permalinks, create files or add anything to robots.txt. Deactivate it and everything it added is removed.

Dynamic

The sitemap is built from your live content, not from a static file. When you publish, update, unpublish or delete a post, the sitemap reflects it on the next request.

How it works

  1. /sitemap.xml is a sitemap index that points to one sitemap per post type, such as /sitemap-post-1.xml, /sitemap-page-1.xml or /sitemap-product-1.xml.
  2. Each post type sitemap lists up to 2,000 URLs with their last modified date. Larger post types are split into -2.xml, -3.xml and so on.
  3. Sitemaps are built on first request and cached. Publishing, updating, unpublishing, trashing or deleting a published post refreshes them straight away.

Features

  • No setup: works right after activation, with no settings screen. No need to visit Settings > Permalinks.
  • Includes posts, pages and every public custom post type that has viewable URLs, including WooCommerce products and post types added by other plugins. Media attachments are left out.
  • Only published posts are listed. Drafts, private posts and password-protected posts are never included.
  • Adds a homepage entry (/sitemap-home.xml) when your homepage shows your latest posts. A static front page is listed as a normal page.
  • Adds a Sitemap: line to your virtual robots.txt so search engines find the sitemap on their own.
  • Turns off the built-in WordPress sitemap (/wp-sitemap.xml) so search engines see one sitemap, not two.
  • Stable pagination: posts are ordered by ID, so edits never move posts between sitemap pages.
  • Fast: generated sitemaps are cached for up to 12 hours and refreshed only when published content changes.
  • Works with plain permalinks too, at /?nirositemap=index.
  • Multisite compatible: each site gets its own sitemap.
  • No external services, no tracking, no ads.

What NiroSitemap changes on your site

  • Adds the rewrite rules for /sitemap.xml, /sitemap-home.xml and /sitemap-{post-type}-{number}.xml, and removes them when you deactivate the plugin.
  • Stores two small options (nirositemap_version and nirositemap_bust), which are deleted when you deactivate the plugin.
  • Stores generated sitemaps as transients. They expire on their own within 12 hours.

NiroSitemap does not write any files. If a real sitemap.xml file exists in your site’s root folder, your web server serves that file instead, so delete it to use NiroSitemap.

Privacy

NiroSitemap does not collect or send any data. It does not contact search engines. They read the sitemap when they visit your site.

For developers

Filters:

  • nirositemap_post_types — array of post type names to include.
  • nirositemap_query_argsWP_Query arguments for each post type, with the post type as the second argument. Use it to exclude posts, for example ones marked noindex.

Example: exclude a post type and posts with a meta flag.

add_filter( 'nirositemap_post_types', fn( $types ) => array_diff( $types, array( 'my_cpt' ) ) );

add_filter( 'nirositemap_query_args', function ( $args ) { $args['meta_query'] = array( array( 'key' => '_noindex', 'compare' => 'NOT EXISTS' ) ); return $args; } );

After changing these filters, update any published post, or wait up to 12 hours, to see the change.

Installation

  1. In your dashboard, go to Plugins > Add New Plugin, search for “NiroSitemap”, then click Install Now. Or upload the nirositemap folder to /wp-content/plugins/.
  2. Activate the plugin.
  3. Open https://your-site.com/sitemap.xml to see your sitemap, then submit that URL in Google Search Console and Bing Webmaster Tools.

FAQ

Do I need to configure anything?

No. Activate the plugin and your sitemap is ready at /sitemap.xml. Then submit that URL once in Google Search Console and Bing Webmaster Tools.

Where is my sitemap?

At /sitemap.xml on your site, for example https://example.com/sitemap.xml. If your site uses plain permalinks, it is at https://example.com/?nirositemap=index.

My sitemap shows a 404 or a different sitemap.

Check for these, in order:

  • A real sitemap.xml file in your site’s root folder. Your web server serves it before WordPress loads. Delete it.
  • Another plugin serving /sitemap.xml, such as Yoast SEO, Rank Math or All in One SEO. Turn off that plugin’s sitemap feature, or deactivate NiroSitemap.
  • A caching plugin or CDN holding an old copy. Clear its cache.

Why is there no Sitemap line in robots.txt?

NiroSitemap only adds it when Settings > Reading > Search engine visibility allows search engines to index your site. The line is also missing if a real robots.txt file exists in your site’s root folder. Add the line to that file yourself.

Which post types are included?

Every public post type that has viewable URLs, except media attachments. That includes posts, pages and custom post types from your theme or other plugins. Developers can change the list with the nirositemap_post_types filter.

Are categories, tags and author pages included?

No. NiroSitemap lists posts, pages and custom post types only.

How quickly do new posts appear?

Right away. Publishing, updating, unpublishing or deleting a published post refreshes the sitemap on its next request.

Does it ping Google?

No. Google retired sitemap pings in 2023. Submit your sitemap once in Google Search Console, and Google will check it regularly after that.

What happens when I deactivate or delete NiroSitemap?

Deactivating removes the sitemap URLs and deletes the plugin’s options. The built-in WordPress sitemap at /wp-sitemap.xml comes back. Cached sitemaps expire on their own within 12 hours.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“NiroSitemap – No-Setup Dynamic XML Sitemap” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.9

  • Initial release.