- IndexNow tells participating search engines that a URL changed. It does not guarantee crawling, indexing, or ranking, and Google does not use it for Search.
- Submit from the events that actually change content, such as a CMS publish or update webhook or an on-demand revalidation, and never from every deploy or request.
- Verify in two places: the HTTP response from the IndexNow endpoint, and your own server logs showing which bots fetched the URL afterward.
If you run a Next.js site and want Bing and Yandex to hear about new or changed pages quickly, IndexNow is a reasonable thing to add. It is a small HTTP protocol: you send a list of changed URLs to an endpoint, the endpoint passes the notice to participating search engines, and you get back a status code. That is the whole feature. It does not force a crawl, it does not guarantee an index entry, and it is not a ranking signal. The rest of this article is about doing it cleanly in a Next.js project, where the real work is less about the HTTP call and more about deciding when to make it, making sure the URL actually renders useful HTML, and checking afterward that anything happened.
What IndexNow is, and who actually uses it
IndexNow was introduced in 2021 by Microsoft Bing and Yandex. The idea is simple. Rather than waiting for a crawler to rediscover a page, the site owner pings a shared endpoint with the URLs that were created, updated, or deleted. Participating engines share those notices with each other, so a submission to one endpoint reaches more than one search engine.
As of this writing, Bing and Yandex are the engines most people mean when they talk about IndexNow results, and the protocol has been adopted by several other search providers over time. Google has discussed and tested the protocol but has not adopted it for Google Search. If your traffic depends heavily on Google, IndexNow will not change how Google discovers your pages. Keep your sitemap current, keep your internal links honest, and make sure your pages are crawlable in the normal way. IndexNow is an addition to that work, not a substitute.
This matters for expectations. A successful submission tells you that the endpoint accepted the notice. It does not tell you that the engine crawled the URL, that it indexed it, or that the page moved in rankings. Those are separate events, controlled by the engine, and they depend on many things unrelated to IndexNow. Treat the protocol as a way to shorten the time between "content changed" and "the engine knows about it," and measure whether that shortening happens rather than assuming it does.
What it will not do
It helps to be specific about the limits before writing code, because most of the bad IndexNow setups we see come from a team expecting a guarantee.
It will not make a thin or duplicate page rank. If the page does not deserve to be indexed, a notice will not change that. It will not override a noindex directive, a canonical pointing elsewhere, or a robots rule that blocks crawling. It will not help a URL that returns a soft 404 or an empty shell to the crawler. And it will not cause an engine to crawl at a particular time. Engines schedule crawling by their own logic, and a notice is one input among many.
Knowing this changes what you optimize. You stop asking "how do I make sure every change gets indexed within an hour" and start asking "does my site expose a clean, accurate signal whenever content changes, and do I have evidence that the signal is being received?" The second question is answerable. The first is not.
Hosting the key file
IndexNow requires a key, which is a string you generate. It should be between 8 and 128 characters and use letters, numbers, and hyphens. You prove ownership of the host by making that same key available at a publicly reachable URL on the domain you are submitting for. The engine fetches the key file and checks that its contents match the key in your request.
There are two common ways to host it in Next.js.
The first, and simplest, is the public folder. Generate a key, for example a long random hex string, and create a file named after it. If the key is 4f9c2a7e8b1d4e6fa03c9d2b7e5a1f80, the file is public/4f9c2a7e8b1d4e6fa03c9d2b7e5a1f80.txt, and its contents should be exactly that key with nothing else. Next.js serves anything in public at the site root, so the file is reachable at your domain followed by that file name. That is the whole setup. Commit the file, deploy, and open the URL in a browser to confirm it returns the key as plain text.
The second option is a route handler or a rewrite, which is useful if you want the key to come from an environment variable and not sit in your repository. A route handler can read the key from the environment and return it only when the requested path matches that key. This keeps the key out of source control, but it adds a moving part: if the handler breaks, your key file disappears and submissions start failing. If you choose this route, test the endpoint after every deploy, and keep the response as a plain text body with a text/plain content type.
Whichever option you pick, be consistent. The key you send in the POST body must match the key served at the file URL, and the keyLocation you submit (if you include one) must point to the exact URL where the file lives. A common mistake is serving the file on example.com while submitting for www.example.com. Keep the host, the key file, and the submission aligned.
One practical note: do not reuse the same key across unrelated sites, and do not treat the key as a secret in the sense of an API credential. Its purpose is ownership proof, and it is visible to anyone who fetches the file. Rotating it is a matter of generating a new key, hosting the new file, updating the environment, and only then retiring the old file.
Deciding when to submit
This is the part that matters most, and it is where teams most often go wrong. The question is not "how do I call the endpoint" but "which event should cause a call."
The right triggers are events where content actually changed. In a typical Next.js site, that means one of these:
A CMS webhook fires when an editor publishes or updates an entry. The webhook handler receives the entry, works out the public URLs affected by the change (the page itself, its listing pages, any tag or category pages that display it), and submits those URLs. This is the cleanest trigger because the event carries the information you need: what changed and what URL it affects.
On-demand revalidation is the second strong trigger. If your site uses incremental static regeneration with revalidatePath or revalidateTag called from a route handler or server action, that call is already the moment the server knows a page has new content. Adding an IndexNow submission next to the revalidation call ties the two together. The page was regenerated, so the notice goes out for the same URL. The important detail is that you submit the URLs you revalidated, not a broad guess.
Build or deploy hooks are the third option, and the one to be most careful with. A deploy can change hundreds of pages for reasons unrelated to content, such as a layout tweak, a dependency bump, or a design change to the header. Submitting every URL in the sitemap on every deploy looks thorough and is usually counterproductive. It sends notices for pages nothing happened to, it adds noise to whatever the engines think of your submission behavior, and it makes it impossible to tell later which submissions reflected real content changes. If you do want a deploy-time submission, limit it to a diff: compare the new build's content hashes or the sitemap's lastmod values against the previous deploy, and submit only what changed.
Do not submit on request. A handler that calls IndexNow on every page view is a bad design no matter how much traffic you have. It produces huge numbers of redundant notices, it can get your key rate limited or flagged, and it has no relationship to content changes. The submission belongs on the write path, when content is created, updated, or removed, not the read path.
Deletions deserve their own consideration. When a page is removed, submitting its URL tells the engine the page is gone, which can help it drop the URL sooner. Make sure the removal is real: the URL should return a 404 or 410, or redirect to a relevant replacement, before you send the notice. Submitting a removed URL that still returns a 200 with a placeholder is worse than not submitting at all.
The submission call
Below is a compact example of a server-side function that takes a list of changed URLs, filters them to the right host, splits them into batches, and posts each batch to the IndexNow endpoint. It is written to run in a Next.js route handler, a server action, a webhook handler, or a build script. It should never run in client code, because it reads the key from the environment.
const INDEXNOW_ENDPOINT = "https://api.indexnow.org/indexnow";
const MAX_URLS_PER_REQUEST = 10000;
export async function submitToIndexNow(urls) {
const host = process.env.SITE_HOST; // e.g. "www.example.com"
const key = process.env.INDEXNOW_KEY; // same value as the key file
if (!host || !key) throw new Error("IndexNow env vars missing");
// Keep only URLs that belong to this host, and remove duplicates.
const unique = [...new Set(urls)].filter((u) => new URL(u).host === host);
const results = [];
for (let i = 0; i < unique.length; i += MAX_URLS_PER_REQUEST) {
const chunk = unique.slice(i, i + MAX_URLS_PER_REQUEST);
const res = await fetch(INDEXNOW_ENDPOINT, {
method: "POST",
headers: { "Content-Type": "application/json; charset=utf-8" },
body: JSON.stringify({
host,
key,
keyLocation: `https://${host}/${key}.txt`,
urlList: chunk,
}),
});
results.push({ status: res.status, count: chunk.length });
// 429 means slow down. Stop this run and let the next event retry.
if (res.status === 429) break;
}
return results;
}
A few things about this code are deliberate. It filters by host, so a stray URL from a different domain in a CMS payload will not be submitted under the wrong key. It deduplicates, because CMS webhooks sometimes fire twice for one edit. It batches at the protocol's per-request ceiling, although in practice most sites will send far fewer URLs per call. It records the status for each batch so you can log it. And it stops on a 429 instead of retrying in a tight loop, because hammering a rate-limited endpoint is the fastest way to get your submissions ignored.
It does not retry on other errors, and that is intentional for a first version. A 400 or 422 means the payload is wrong and retrying will not fix it. A 403 usually means the key file is not reachable or does not match, which you should fix rather than retry. A 5xx is a reasonable candidate for a retry on the next event, since your next publish or revalidation will naturally resubmit the URL if it changes again.
Call the function from the event that changed the content. For a CMS webhook, that is the handler that receives the publish event. For revalidation, it is the code path that just regenerated the page. Keep the call outside the rendering path so a slow or failing IndexNow request never delays the page or the webhook response. Fire it, log the result, and move on.
Batching changed URLs
Batching matters for two reasons. The first is efficiency: one request carrying twenty URLs is cleaner than twenty requests carrying one each. The second is that batching gives you a natural place to deduplicate and to apply your own limits.
A sensible pattern is to collect changed URLs during a short window, then submit them together. A CMS that fires one webhook per field edit might produce a burst of events for a single article. Rather than submitting the article URL five times, collect the URLs for a few seconds, deduplicate, and submit once. A simple in-memory queue works for a single-instance deployment. On serverless platforms where each invocation is isolated, you may need a durable queue, or you can accept that each invocation submits its own URLs and rely on deduplication at the CMS layer.
Be honest with yourself about the scale you actually need. A site that publishes a few articles a day does not need a sophisticated queue. It needs one submission per publish event and a log line. Build the simplest thing that handles your real traffic, and add machinery only when the logs show a problem.
Avoiding the deploy storm
A recurring problem with IndexNow is what we call the deploy storm. A team adds a post-build script that submits the full sitemap after every deploy. It works the first time, it feels responsible, and then it runs on every merge to main. Dozens of deploys a week turn into dozens of full-sitemap submissions, most of which contain URLs nothing happened to.
There are better patterns. Submit from content events, not build events, wherever you can. If you must have a build step, make it diff-based. Keep a manifest of content hashes from the last successful submission, compute the current hashes during the build, and submit only the URLs whose hashes changed. Store the manifest somewhere durable, such as a file in object storage or a row in your database, not the build workspace, which may be discarded.
Also watch for the opposite problem: a deploy that changes URL structure or removes pages without submitting anything. If you rename a slug, the old URL should redirect and the new URL should be submitted. Renaming without redirects and without a notice is how sites end up with a long tail of dead URLs that engines keep trying to fetch.
SSR and SSG: make sure the URL renders real HTML
Submitting a URL only helps if the page behind it is worth crawling. This is an area where Next.js setups can quietly fail.
If a page is rendered entirely on the client, the crawler may receive a nearly empty HTML shell and whatever metadata is in the head. Some engines execute JavaScript, but you should not rely on that as the only path to your content. The reliable approach is to make sure the server response contains the page's primary content as HTML. With the App Router, that means server components for content-bearing pages, or statically generated pages with the content present in the build output. With the Pages Router, getStaticProps or getServerSideProps should produce the content in the initial HTML.
For static generation, the important point is freshness. A statically generated page is only as current as its last build or revalidation. If you submit a URL after a content change, but the page is still served from the old static HTML because revalidation has not run, you have told the engine about a page that still shows stale content. Make sure the revalidation happens before or alongside the submission. In practice, that means calling revalidatePath for the URL first, then submitting it. If you submit first, the engine may crawl the stale version within minutes and keep it until the next visit.
For server-rendered pages, check that the response is fast and does not depend on a per-request dependency that might fail for crawlers. A page that depends on a cookie, a geolocation lookup, or a personalization service may render differently for a bot. Make sure the crawler sees the public version of the page.
Check the metadata too. The title, canonical URL, and robots meta tags should be correct in the HTML the server returns. In the Next.js App Router, that means generateMetadata should produce the right values for the URL being submitted. A canonical that points to a different host or a stale slug undermines the submission entirely.
A quick manual test catches most of these problems. Fetch the URL with curl and look at the raw HTML, not the rendered page in a browser. If the main content is present in that raw response, you are in good shape. If the body is an empty container and a script tag, the crawler may not see your content on its first pass.
Verifying it worked
Verification has two parts, and both matter. Neither alone tells you the whole story.
The first part is the response from the IndexNow endpoint. Log the status code for every submission. A 200 means the notice was accepted. A 202 means the notice was accepted but the key validation is still pending, which usually resolves on its own once the engine fetches the key file. A 400 indicates a malformed request. A 403 usually means the key file was not found at the expected location or its contents do not match the key. A 422 typically means the URLs do not belong to the host you specified. A 429 means you are sending too many requests. Read the status codes and fix the cause, rather than assuming a 200 means everything downstream works.
The second part is the engine's own view. Bing Webmaster Tools is the most practical place to check. Add your site, verify ownership, and look at the crawl and index reports for the URLs you submitted. You can also use the URL inspection features to see what Bing last fetched and how it rendered the page. Watch for patterns: are submitted URLs being crawled, how long does it take, and do the crawled versions match what you expect? The timing will vary, and a single data point tells you little, but a month of data tells you whether the process is doing anything useful for your site.
The third part, and the one most teams skip, is your own server logs. Every time a bot fetches a URL, your server or CDN sees a request with a user agent. If you are logging requests with the user agent and the path, you can answer the most important question directly: after we submitted this URL, which bots fetched it, and how soon? That tells you more than any dashboard from a search engine, because it shows the actual fetch behavior on your own infrastructure.
Set up a simple log query for the crawler user agents you care about, joined with your submission log by URL. Look at the time between submission and first fetch for each engine. Look at the status codes the bot received. A bot that receives a 200 with the right content is a success. A bot that receives a 404, a 500, or a redirect chain is a problem you should fix. A submitted URL that no bot fetches for several weeks is worth investigating: check the sitemap, the internal links to the page, and whether the page is actually indexable.
Be careful about user agent claims. Bots can be spoofed, so for anything important, verify the source IP ranges the engines publish, or rely on the engines' own tools for authoritative data. Your logs are good for patterns, but they should not be the only source of truth for an important decision.
Where InstantIndexingPro fits
Most of the work described above is plumbing you can build yourself. The key file, the submission call, the batching, and the webhook wiring are all doable in a few hundred lines. The harder ongoing problem is knowing whether it is working: which submissions were accepted, which URLs were actually fetched by which bots, and whether the fetches returned the content you intended.
That second part is where InstantIndexingPro is built to help. It submits URLs through IndexNow and keeps a log of which bots fetch each submitted URL, so the submission history and the crawl history sit side by side. Instead of checking a status code in one place and a log file in another, you can see whether a notice for a URL was followed by fetches, and by which crawlers. If you are already doing the wiring described in this article, the value is in closing the loop, not in replacing the HTTP call.
Be clear about what it does not do. It does not make an engine crawl on a schedule of its choosing, and it does not turn a notification into an index entry. It shows you the evidence so you can decide whether your submission process is worth keeping and where to improve it.
What to do next
If you are starting from nothing, here is a practical sequence that keeps the work small and the evidence clear.
First, pick the events that change content on your site. List them honestly: CMS publish and update, revalidation calls, deletions, and any deploy-time changes. Drop any trigger that fires on requests or on every deploy without a diff.
Second, generate a key and host it. Use the public folder unless you have a specific reason not to. Open the file URL in a browser and confirm it returns the key as plain text, with nothing else in the response.
Third, add the submission function, wire it to your first trigger, and log every response code. Start with a single event type, such as CMS publish. Do not wire everything at once.
Fourth, check that the submitted URLs return real HTML with the right canonical and metadata. Use curl on the raw response. Fix any URL that renders an empty shell or a stale version.
Fifth, set up verification. Add your site to Bing Webmaster Tools, confirm the key and host are recognized, and set up a log query that joins submissions with bot fetches for the same URLs.
Sixth, review after a few weeks. Look at which submissions were accepted, which were fetched, and how long it took. Remove triggers that produce noise, and expand only the ones that produce evidence of useful crawling.
Finally, keep your sitemap, internal links, and canonical tags in good shape. IndexNow is a helpful notice, but on its own it is not a strategy. The pages still have to be worth crawling, and the rest of your technical SEO still has to work.