Sitemaps · 29 November 2026

Why noindexed posts turn up in your sitemap, and how to check

A sitemap that lists a page you have marked noindex sends a search engine two opposite instructions. Here is how it happens, how to spot it, and the bug of my own that taught me to test for it.

By Shane Rounce · 3 minute read

Two instructions that disagree

A sitemap says "these are the pages I would like you to know about". A noindex directive says "do not keep this one". When the same address carries both, Search Console reports it as "Submitted URL marked noindex" and you spend crawl attention on a page you never wanted found.

It is an easy state to get into, because the sitemap and the robots directive are usually produced by different code.

How it happens

  • The sitemap is built by one plugin or by WordPress core, and the noindex is set by another. Neither knows about the other.
  • The sitemap is cached, and the cached copy was built before you marked the post.
  • A content type or taxonomy was removed from the sitemap index, but its stored sitemap files are still being served at their old addresses.
  • The query that leaves noindexed posts out has quietly stopped working.

The last two have both happened to me.

The stored sitemap that outlived its exclusion

On one site I excluded a glossary from the sitemaps. It dropped out of the index straight away, which looked right. But the sitemap files themselves, built before the exclusion, were still stored and still answered at their own addresses. Anything that already knew those addresses could keep reading them.

Since version 1.0.99, a sitemap for a content type or taxonomy that has been left out answers 404, even when an older copy is still stored. The rule I took from it: when you exclude something, test the excluded address itself, not only the index.

The query that stopped working

In version 1.0.108 I renamed every stored metadata key to the plugin's own prefix. One step of that rename left the name of a PHP constant inside the text of several database queries, where the value of the constant should have been. The database rejected those queries, the code treated the failure as "no noindexed posts", and for two releases the sitemaps listed posts that were marked noindex.

My before and after comparisons missed it, because both sides of the comparison were already running the broken version. I found it only when I activated the plugin on a fresh site and a sitemap rebuild printed the database error. Version 1.0.110 fixed the queries and 1.0.111 passes the key names as prepared values. There is now a test that fails the build if a constant's name appears inside query text.

How to check your own site

  1. Pick three posts you have marked noindex. View the source of each and confirm the robots meta tag is there.
  2. Open your sitemap index, then the sitemap that would contain those posts, and search for each address. None should be listed.
  3. If you have excluded a content type, request its old sitemap address directly. It should answer 404, not an old list.
  4. In Search Console, open Pages and look for "Submitted URL marked noindex". It should be empty or falling.
  5. Repeat after every plugin update that mentions sitemaps or metadata.

From the command line, with WP-CLI and Ace Crawl Enhancer:

wp ace-crawl sitemaps mark-dirty --scope=all
wp ace-crawl sitemaps run

That rebuilds every sitemap now, and prints any database error instead of hiding it.

The wider lesson

Compare against a known good state, not against yesterday. A comparison between two copies of the same mistake always passes.

All notes Get the latest release