Aditya Sharma

Do You Need an XML Sitemap? Mine Was Missing 163 Posts

On this page, 9 sections

Maybe not. Google’s sitemap overview says you might not need one if your site has about 500 pages or fewer that you want in search, and if all of them can be reached by following internal links. It also says that in most cases a site benefits from having one.

I have a better reason than theory to write this. My own sitemap index was missing 163 of my 563 sitemap-eligible posts, about 29%, for over a month by my own record.

Below is what Google says a sitemap is for, what it ignores, and what happened on this site, with the numbers I checked on 11 October 2026.

What Google says about needing one

The overview page splits it into two lists. You might need a sitemap if your site is large, if your site is new and has few external links, or if it has a lot of rich media or is shown in Google News.

You might not need one if your site is small, comprehensively linked internally, and has few media or news pages you want in search. Google defines “small” as about 500 pages or fewer, counting only pages you think need to be in search results.

The same page says a sitemap helps search engines discover URLs but does not guarantee that everything in it will be crawled and indexed. The build-a-sitemap page adds that submitting a sitemap is merely a hint.

So the question is not “will a sitemap make me rank”. Google does not say it does. The question is whether Googlebot could miss some of your pages without one.

What Google ignores inside the file

Three details from the build page matter to anyone using a plugin to generate the file.

  • Google ignores the priority and changefreq values. There is nothing to gain from tuning them for Google.
  • Google uses lastmod only if it is consistently and verifiably accurate, for example when it matches the page’s real last modification. It should reflect a significant update, such as a change to the main content, structured data or links.
  • One sitemap file is capped at 50 MB uncompressed or 50,000 URLs. Beyond that you split it, and a sitemap index file can list the pieces.

It also asks for fully qualified, absolute URLs and says Google will try to crawl them exactly as listed. That last part is what makes a wrong URL in a sitemap a real problem and not a cosmetic one.

What happened on my site

My sitemaps come from Rank Math, and my robots.txt points to sitemap_index.xml. Here the post sitemaps hold up to 200 URLs each, so 563 posts take three files.

The index I was serving was stale. It listed no post-sitemap3.xml, the file holding the newest 163 posts. My record puts the start of that gap at 5 September 2026. I did not keep dated copies of the index, so treat the start date as my log and not a measurement. I fixed it on 11 October 2026.

Here is the live index when I re-read it on 11 October 2026, with the URL count in each child file:

Child sitemapURLs
post-sitemap1.xml200
post-sitemap2.xml200
post-sitemap3.xml163
page-sitemap.xml6
category-sitemap.xml24
Total593
adityaarsharma.com sitemap_index.xml and its five child files, fetched 11 October 2026.

What I do not know is the cost. I have not measured whether the 163 missing posts were indexed anyway through internal links, or whether any of them were slower to appear. A sitemap is a hint, and my posts link to each other, so I will not claim lost traffic I have not seen.

Why 779 posts became 563 URLs

The WordPress REST API reports 779 posts on this site: the X-WP-Total header on /wp-json/wp/v2/posts said 779 when I checked on 11 October 2026. The sitemap lists 563 post URLs. The gap is 216 posts.

By my check, those 216 respond with a 301 redirect to another address. A sitemap is for URLs you want in search results, and a URL that redirects elsewhere is not the address you want shown, so leaving them out is correct. The arithmetic closes: 779 minus 216 is 563, and 200 plus 200 plus 163 is 563.

Add 6 pages and 24 category archives and you get the 593 in the table. I computed those sums in Python, and I am not claiming anything about why the 216 exist beyond the fact that they redirect.

That check is the one I would repeat on any blog. A REST count that is far above the sitemap count is not automatically a bug. It is a question: are the missing posts redirects, drafts, or posts the index lost?

Core sitemaps and plugins

WordPress also builds sitemaps on its own. I read the posts provider in the wordpress-develop trunk on 11 October 2026: it queries for posts with the publish status, and its lastmod comes from the post’s modified date in GMT. So a scheduled post enters the core sitemap only when it flips to published.

I compared the core sitemap with plugin sitemaps in WordPress sitemaps: core versus plugin. I only measured the stale-index failure on the plugin side and did not test it on core. Which generator to use is that post’s question. Mine here is narrower: whatever builds the file, check what it lists.

My rule, which is opinion

Google says a small, well-linked site might not need a sitemap. I did not find a line on those pages saying a sitemap hurts. WordPress and its SEO plugins can generate one, so I would keep it on and check it, not debate it.

I would treat it as required if you are past roughly 500 pages, if the site is new with few links in, or if you publish video, images or news you want in search. Those are Google’s own conditions.

If you read Search Console data to judge a blog, rule out the boring file problems first. I split my own export in what 31,305 impressions and 81 clicks look like. Checking the sitemap takes two minutes, so I do it first.

What I could not verify

  • Why my index went stale. I know the symptom and the date I fixed it, not the cause inside Rank Math.
  • The start date of the gap, 5 September 2026. It comes from my own record, not from a dated copy of the file.
  • Any effect on indexing or traffic from the 163 missing posts.
  • Whether Search Console’s Sitemaps report would have flagged it. I did not check what it showed during the gap.

Do this today

Count what your sitemap really lists. This script reads your index, waits 2 seconds between requests, and prints the URL count per child file. Change the SITE line to your domain. I ran it against this site on 11 October 2026 and it printed the table above.

import re, time, urllib.request

SITE = "https://adityaarsharma.com"

def get(url):
    req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
    with urllib.request.urlopen(req, timeout=30) as r:
        return r.read().decode("utf-8")

index = get(f"{SITE}/sitemap_index.xml")
children = re.findall(r"<loc>([^<]+)</loc>", index)
total = 0
for url in children:
    time.sleep(2)
    n = len(re.findall(r"<url>", get(url)))
    total += n
    print(f"{n:5d}  {url}")
print(f"{total:5d}  total URLs in {len(children)} child sitemaps")

Then open yoursite.com/wp-json/wp/v2/posts?per_page=1 and read the X-WP-Total response header for your post count. Compare the two. If the sitemap is short, find out whether the missing posts redirect, are unpublished, or fell off the index, and resubmit the sitemap in Search Console once it is right.

Resources

Tell me where I am wrong

Your email is not published and I do not add it to any list. Corrections with a source are the ones I act on fastest.