Automate Indexing with IndexNow and Dynamic Sitemaps

Automate indexing with IndexNow for Bing and other engines, a dynamic sitemap with accurate lastmod for Google, and one publish hook that keeps both current.

By the MakeItFlow team Updated 9 min read
Share LinkedIn X Facebook WhatsApp
Automate Indexing with IndexNow and Dynamic Sitemaps

To automate indexing, do two things whenever content changes: send the URL to IndexNow, which notifies Bing, Yandex, Naver, Seznam, Yep and other participating engines immediately, and update a dynamic XML sitemap with an accurate lastmod for Google, which doesn't use IndexNow. A CMS plugin or a single publish hook can handle both.

Once it's set up, run your sitemap through our free sitemap checker to confirm it's valid, lists only indexable URLs and carries believable lastmod dates.

Key takeaways

  • IndexNow lets a site notify Bing, Yandex, Naver, Seznam, Yep and other participants the moment a URL is added, updated or deleted, and one submission is shared with all of them.
  • Google does not use IndexNow, so for Google the reliable automation is an accurate XML sitemap referenced in robots.txt and submitted in Search Console.
  • Google uses lastmod only when it is consistently accurate, so generate it from the date the main content really changed, not the time the sitemap was built.
  • The sitemap ping endpoints were retired, so code that still pings Google or Bing after publishing does nothing useful and can be removed.

What automation can and can't do

Automated submission speeds up discovery: how quickly a search engine learns that a URL exists or has changed. It doesn't guarantee indexing. Search engines still decide whether a page is worth keeping, so thin, duplicate or blocked pages won't get in faster just because you pinged them. If pages are being found but not indexed, the problem is elsewhere; see crawled and discovered but not indexed.

Search engine Fastest automated signal Supports IndexNow?
Google Sitemap with accurate lastmod, found via robots.txt or Search Console No
Bing IndexNow, plus sitemaps Yes
Yandex, Naver, Seznam, Yep IndexNow Yes

For the manual side of getting pages into Google (request indexing, internal links, removing blockers), see how to get Google to index your site faster.

Part 1: IndexNow

IndexNow is an open protocol launched by Microsoft Bing and Yandex in 2021. You tell a participating engine "these URLs were added, updated or deleted", and it shares the submission with every other participant. According to the IndexNow FAQ, submitting to one endpoint is enough; you don't need to submit to each engine separately. The official list of participants currently includes Bing, Yandex, Seznam, Naver, Yep, the Internet Archive and Amazonbot.

Google tested IndexNow after its launch but has never adopted it. Google's crawling still relies on links, sitemaps and its own scheduling.

Bing is worth the effort for most sites: it powers Bing search, results inside Microsoft Copilot, and a number of other search products. Our post on Bing Webmaster Tools and IndexNow in 2026 covers why.

Step 1: create and host a key

The key proves you own the site. It must be 8 to 128 characters long, using only letters, numbers and hyphens. Generate one:

openssl rand -hex 16
# e.g. 3f9c2a7e5b1d48f0a6c3e2b9d7f14a58

Save it in a UTF-8 text file named after the key, containing only the key, at the root of your site:

https://example.com/3f9c2a7e5b1d48f0a6c3e2b9d7f14a58.txt

If you can't put files at the root, you can host it elsewhere on the same host and pass its location with the keyLocation parameter. Make sure the file returns 200 with no redirect, and that a security rule or "coming soon" plugin isn't blocking it.

Step 2: submit URLs

A single URL is a simple GET request:

curl "https://api.indexnow.org/indexnow?url=https://example.com/blog/new-post&key=3f9c2a7e5b1d48f0a6c3e2b9d7f14a58"

For several URLs at once, POST JSON. One request can carry up to 10,000 URLs, all on the same host:

curl -X POST "https://api.indexnow.org/indexnow" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
    "host": "example.com",
    "key": "3f9c2a7e5b1d48f0a6c3e2b9d7f14a58",
    "urlList": [
      "https://example.com/blog/new-post",
      "https://example.com/services/web-design"
    ]
  }'

Step 3: read the response

Code Meaning What to do
200 Received and processed Nothing
202 Accepted; key validation pending Normal on the first submission
400 Bad request Check the JSON and URL encoding
403 Key not valid Key file missing, wrong content or blocked
422 URLs don't match the host, or key mismatch Submit only URLs on the host named in the request
429 Too many requests Slow down and stop resubmitting unchanged URLs

What to submit, and what not to

Submit a URL when it's published, when its main content changes, or when it's deleted or redirected (so the engine can drop or update it). Don't resubmit your whole site on a schedule, and don't submit URLs that haven't changed. That wastes your crawl goodwill and can trigger rate limits.

Option A: let your CMS or CDN do it

You probably don't need to write any code:

  • WordPress: the official IndexNow plugin from the Bing Webmaster team submits pages automatically when they're published, updated or deleted, and skips noindexed pages. Rank Math also includes an IndexNow module, and other SEO plugins offer it. Use one of them, not several, or every change gets submitted multiple times.
  • Cloudflare: Crawler Hints, available on all plans including Free, notifies IndexNow when Cloudflare sees that content has likely changed. It's a single toggle under your zone's Configuration settings.
  • Shopify: Microsoft has said Shopify supports IndexNow, so stores don't need an app for it.
  • Other platforms: check your CMS documentation or Bing's list of integrations before building your own.

Option B: a publish hook

On a custom site, call IndexNow from the code that saves content. A minimal PHP example you can adapt to Laravel, Symfony or plain PHP:

function indexnow_submit(array $urls): int
{
    $payload = json_encode([
        'host'    => 'example.com',
        'key'     => getenv('INDEXNOW_KEY'),
        'urlList' => array_values($urls),
    ]);

    $ch = curl_init('https://api.indexnow.org/indexnow');
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => $payload,
        CURLOPT_HTTPHEADER     => ['Content-Type: application/json; charset=utf-8'],
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 10,
    ]);
    curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    return $status; // log anything other than 200 or 202
}

Run it from a background queue rather than during the editor's save request, so a slow response doesn't hold up the page. Log the status code, and batch changes made in quick succession into one request.

Check it's working

In Bing Webmaster Tools, the IndexNow section shows the URLs Bing received from your site and any errors. If it stays empty after you've published, check the key file URL in a browser first.

Part 2: dynamic sitemaps with accurate lastmod

For Google, the sitemap is the main automated signal. Google's documentation says it uses lastmod "if it's consistently and verifiably accurate", and it ignores priority and changefreq. For the basics of sitemap structure and limits, see our XML sitemap guide. Here we focus on keeping it current automatically.

Generate the sitemap from your database

A static sitemap.xml that someone regenerates by hand goes stale. Build it on request from the same data that powers your pages, and cache it for a few minutes if the site is large. Most CMSs already do this (WordPress core has had a built-in sitemap since version 5.5, and SEO plugins replace it with their own).

The rules for a sitemap that search engines trust:

  • Only canonical, indexable URLs that return 200. No redirects, no noindexed pages, no parameter duplicates.
  • lastmod comes from the content, not the clock. Store a "content last changed" timestamp that updates when the body, title, structured data or important links change, and not when someone fixes a typo in the footer or a view counter ticks.
  • Never set every lastmod to now. A sitemap where all dates equal the generation time tells Google the field is unreliable, and it may then ignore it for your whole site.
  • Remove deleted URLs promptly. Return a 404 or 410 for the page, or redirect it, and drop it from the sitemap.

A sketch of the logic:

foreach ($pages->where('indexable', true)->where('status', 'published') as $page) {
    echo "<url><loc>" . htmlspecialchars($page->canonical_url) . "</loc>";
    echo "<lastmod>" . $page->content_updated_at->toAtomString() . "</lastmod></url>\n";
}

The key detail is content_updated_at, a field your editor updates deliberately, rather than the framework's generic updated_at, which changes on every save.

Tell search engines where it lives

Reference the sitemap in robots.txt, which every major engine reads:

Sitemap: https://example.com/sitemap.xml

Then submit it once in Google Search Console under Sitemaps, and once in Bing Webmaster Tools. You don't need to resubmit after each change. Google refetches sitemaps it knows about on its own schedule.

If you manage many sites, the Search Console API has a sitemap submission method, so you can register sitemaps for new client sites from a script instead of clicking through each property.

Remove the old ping code

Many older plugins and scripts "ping" Google or Bing with the sitemap URL after every publish. Google deprecated its sitemap ping endpoint in June 2023 and it no longer works; Bing had already retired anonymous sitemap submissions in 2022. Those calls do nothing now. Replace them with IndexNow for Bing and an accurate lastmod for Google.

Putting it together: one publish workflow

Event Sitemap IndexNow
New page published Added with lastmod = publish time Submit the URL
Main content updated lastmod updated Submit the URL
Typo or footer change No change Don't submit
Page deleted (404/410) Removed Submit the URL
Page redirected (301) Old URL removed, new URL added Submit both
Page set to noindex Removed Submit the URL

Once a month, check the Search Console Pages report and the Sitemaps report for errors, and spot-check that important new pages are indexed with the URL Inspection tool. Our free Search Console and Bing Webmaster dashboard puts both engines' data in one place, with a weekly email, so you can see whether new pages start getting impressions. Then run the sitemap checker after any CMS update, plugin change or migration, because that's when sitemaps most often break.

FAQ

Does Google support IndexNow?

No. Google said in 2021 that it would test the protocol, but it hasn't adopted it. For Google, keep an accurate XML sitemap referenced in robots.txt and submitted in Search Console, and use the URL Inspection tool's Request Indexing button for the occasional important page.

Will IndexNow get my pages indexed faster?

It gets them discovered faster by Bing and the other participating engines, often within a short time of publishing. Whether a page is then indexed still depends on its quality, uniqueness and whether anything blocks it. IndexNow can't make an engine index a page it doesn't want.

Do I need to submit to Bing and Yandex separately?

No. IndexNow shares each submission with all participating engines, so one request to any endpoint, including the shared api.indexnow.org endpoint, is enough. Submitting the same URL to several endpoints just duplicates work.

Can I use more than one IndexNow plugin?

You can, but you shouldn't. Two plugins mean every change gets submitted twice, which wastes requests and makes errors harder to trace. Pick one, such as the official Bing plugin or the module in your SEO plugin, and disable the others.

How often should my sitemap update?

Whenever a URL is added, removed or meaningfully changed. A dynamic sitemap generated from your database does this automatically. What matters is not how often the file changes but that each lastmod reflects a real content change.

Should I still use the Google Indexing API?

Only for the page types Google supports it for, which are job postings and livestream (broadcast event) pages. Google's documentation doesn't support using it for ordinary pages, so for everything else use sitemaps and Search Console.

#indexnow #xml sitemap #indexing #automation

Written by the MakeItFlow team

We build the website audit these guides are based on. Every fact is checked against the primary sources listed above and this guide was last reviewed on 25 October 2026 . How we research and check

Share LinkedIn X Facebook WhatsApp

Check your own site in 30 seconds

Run a free audit covering speed, SEO, DNS, email authentication and security headers — and get a prioritised fix list.

Weekly newsletter

One practical website fix, every week

New guides on speed, SEO, email deliverability and security — straight to your inbox. No spam, unsubscribe in one click.

Keep reading