Sub topic 14
Sitemaps, IndexNow, and keeping the index current
This chapter assumes you know how a crawler discovers and indexes pages, can read HTTP status codes and headers, and can run curl from a terminal. It covers how to tell search indexes that your pages exist or have changed. Answer engines can only cite what their index holds, and the index lags behind your site.
Why freshness is an index problem
An answer engine does not read your site live for most questions. It queries an index built earlier by a crawler. If you update a price, fix an error, or publish a new guide, the engine keeps using the old copy until the crawler returns and the index is rebuilt.
Two things can go wrong:
- A new page is missing from the index, so it cannot be retrieved at all.
- An updated page is in the index, but with stale content, so the engine quotes the old text.
Some engines also fetch a page live when a user asks about a specific URL. That fetch is separate from index freshness. Do not count on it for ordinary questions.
You have two tools for narrowing the gap. A sitemap tells crawlers what exists and when it changed. IndexNow pushes a notice to participating search engines the moment something changes.
Sitemaps
A sitemap is an XML file that lists the URLs you want crawled. It is a hint, not a command. A crawler may ignore entries, but a clean sitemap makes discovery faster and more complete, especially for new sites, deep pages, and pages with few inbound links.
A minimal sitemap looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/guide</loc>
<lastmod>2026-06-01</lastmod>
</url>
<url>
<loc>https://www.example.com/pricing</loc>
<lastmod>2026-11-20</lastmod>
</url>
</urlset>Rules that matter
- Each
locmust be a full, absolute URL on the same host as the sitemap. - A single sitemap file may hold up to 50,000 URLs and 50 MB uncompressed. Larger sites use a sitemap index file that points to several sitemaps.
- List only canonical URLs that return
200. Redirected, blocked, ornoindexURLs waste crawl effort and teach crawlers to distrust the file. - Do not list URLs that
robots.txtblocks. The two files would contradict each other.
Make lastmod honest
lastmod is the field that matters most for freshness. Set it to the date the page's meaningful content last changed. Do not set it to the build date or to the current time on every deploy.
Search engines compare lastmod with their own records. If they see that it changes on every page without any real change, they learn to ignore it. Then your genuine updates lose the signal too.
Google has said it ignores priority and changefreq. Other engines do not rely on them either, so you can leave both out.
Telling crawlers where the sitemap is
Add a Sitemap line to robots.txt. It is independent of any User-agent group, so it applies to all crawlers.
User-agent: *
Allow: /
Sitemap: https://www.example.com/sitemap.xmlYou can also submit the sitemap in each search engine's webmaster tools, such as Bing Webmaster Tools. Submission gives you reports on how many URLs were found and which ones had errors.
IndexNow
IndexNow is an open protocol for notifying search engines that a URL was added, updated, or deleted. You send one request, and the participating engines share it with each other. Bing supports it, and Copilot draws on Bing's index, so a notice can shorten the delay before a change appears in what Copilot retrieves.
Not every engine takes part. Google does not use IndexNow. Treat it as one tool alongside sitemaps, not as a replacement for them.
Set up a key
IndexNow proves that you own the site with a key file.
- Generate a random key of 8 to 128 characters, using letters, digits, and dashes.
- Save it as a plain text file named after the key, for example
https://www.example.com/your-indexnow-key.txt. The file contains only the key. - Send a notification that includes the key and the file's location.
The engine fetches the key file to check that it matches. If the file is missing or the key differs, the request is rejected.
Submit URLs
This request submits one changed URL:
curl -X POST "https://api.indexnow.org/indexnow" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"host": "www.example.com",
"key": "your-indexnow-key",
"keyLocation": "https://www.example.com/your-indexnow-key.txt",
"urlList": ["https://www.example.com/guide"]
}'The response status tells you what happened:
| Status | Meaning |
|---|---|
| 200 | The request was accepted. |
| 202 | The request was received, and key validation is pending. |
| 400 | The request was malformed. |
| 403 | The key is invalid or the key file could not be verified. |
| 422 | A URL does not belong to the host, or the key does not match the schema. |
| 429 | You are sending too many requests. |
What IndexNow does and does not do
A 200 means the notice was accepted. It does not mean the page has been crawled, indexed, or ranked. The engine decides whether and when to fetch the URL, and it may skip low-quality or duplicate pages. The notice also does nothing for engines that do not participate.
Submit real changes only. Resubmitting unchanged URLs on a timer can lead to rate limiting and reduced trust in your notices. You can send many URLs in one urlList (up to 10,000 per request) instead of one request per page. Deleted pages can also be reported. Submit the URL after it starts returning 404 or 410.
Keeping content current in practice
Notification speeds up discovery, but the index only improves if the page itself is worth refreshing. A workable routine looks like this:
- Change the page content and update the visible "last updated" text and the
dateModifiedvalue in your structured data, so the page and its metadata agree. - Update
lastmodin the sitemap to the same date. - Send an IndexNow notice for the URL.
- Confirm the crawler came back by checking your access log for its user agent, as described in the chapter on checking crawler access.
- Ask the engine a question that the changed page should answer, and see whether the new text appears.
Step 1 matters because the three dates should match. A sitemap that says "changed yesterday" for a page that says "updated in 2023" sends mixed signals.
Common errors
- Stale caches. A CDN or server cache may serve the old HTML to the crawler even after you publish. Purge the cache or lower its lifetime for content pages.
- Blocked crawler. The URL is listed in the sitemap, but
robots.txtor a firewall rule blocks the search crawler. The notice succeeds and the fetch fails. - Soft errors. A page returns
200with an error message or a login wall. The index may store that useless text. - Content only in JavaScript. If the main text appears only after client-side rendering, some crawlers store an empty shell. Serve the key text in the initial HTML.
- Noisy
lastmod. Every URL shows the same recent date, so the signal is ignored. - Redirect chains. Sitemaps that list old URLs force extra hops, and some of the chain may not be followed.
Check your understanding
Exercise
A site redeploys nightly, and its build script sets every sitemap lastmod to the current date. Explain why this hurts freshness, and say what the script should do instead.
Show answer
Search engines compare lastmod with what they know about each page. When every URL shows a new date but most pages have not changed, the crawler learns that the field is unreliable and starts ignoring it, so real updates lose their signal and crawl effort is wasted on unchanged pages. The script should take lastmod from the date the page's content actually changed, for example from the content's modification time in the source repository or CMS, and leave it unchanged when only the template or build changed.
Exercise
You send an IndexNow request for an updated page and receive a 200 response. Two days later an answer engine still quotes the old text. List three possible reasons.
Show answer
A 200 only means the notice was accepted, not that the page was crawled or indexed. Possible reasons: (1) the engine does not take part in IndexNow, or it has not yet recrawled the URL; (2) a CDN or server cache served the old HTML to the crawler, or a firewall or robots.txt rule blocked it; (3) the engine is using a cached or previously stored passage, or the updated content is rendered only by JavaScript and the crawler stored the old version. Checking the access log for the crawler's user agent and requesting the URL as the crawler would see it helps separate these cases.