Table of Contents
- What IndexNow Actually Does for a Next.js Site
- Generate and Host Your IndexNow API Key in the Public Folder
- Build a Next.js Route Handler That Submits URLs to IndexNow
- Trigger Submissions on Publish, Not on Every Build
- Confirm IndexNow Pings Are Landing in Bing Webmaster Tools
- IndexNow vs Sitemap Submission vs Manual URL Inspection
- Why Clean Technical SEO Still Decides Whether Pages Get Indexed
- FAQ
You publish a new page on your Next.js site and then wait. Bing's crawler might show up in a day, might show up in two weeks, and there's no dashboard telling you why. IndexNow fixes the waiting part of that problem: it's a free, plugin-free way to tell Bing and Yandex the second a page changes, instead of hoping their crawl schedule lines up with yours.
This is a setup guide, not a theory piece. By the end you'll have a working key file, a route handler that submits URLs, and a publish-triggered process instead of a build-triggered one.
What IndexNow Actually Does for a Next.js Site
IndexNow is a shared protocol: one ping notifies every participating search engine at once, instead of each engine discovering your change on its own schedule. Bing and Yandex both consume IndexNow submissions, and because the protocol is open, other engines can adopt it without you changing anything on your end.
It's important to be precise about what this is. IndexNow is push-based indexing, not a ranking signal. It doesn't make Bing rank your page higher or crawl it more favorably; it only shortens the gap between "you published" and "the engine knows you published." Think of it as a doorbell, not a recommendation letter.
Here's the catch that trips people up: Google does not currently consume IndexNow pings. If your primary indexing concern is Google, you still need a clean XML sitemap, a correctly configured robots.txt, and submission through Google Search Console. IndexNow is additive for Bing and Yandex coverage, not a replacement for your Google indexing workflow.
What to remember: IndexNow speeds up discovery for the engines that support it. It doesn't touch rankings, and it doesn't do anything for Google.
Generate and Host Your IndexNow API Key in the Public Folder
Setup has three steps, and order matters because step three depends on steps one and two being correct.
- Generate a key. Any random alphanumeric string between 8 and 128 characters works, no spaces, no special formatting required. A UUID with the dashes stripped out is a common choice.
- Create the key file. Name a file
{key}.txtcontaining only the key string, with no extra whitespace or line breaks, and drop it in your/publicfolder. Next.js serves anything in/publicat the site root automatically, so no routing config is needed. - Verify the file is live. Before writing any submission code, open
https://yourdomain.com/{key}.txtin a browser and confirm the raw key string loads with a 200 response.
Skipping step three is the single most common reason IndexNow submissions fail later. The API checks that the key file is reachable at your domain before it accepts a submission, so a typo in the filename or a misconfigured redirect will silently break everything downstream.
Build a Next.js Route Handler That Submits URLs to IndexNow
With the key hosted, you need an endpoint that actually sends the submission. In the App Router, that's a route handler at app/api/indexnow/route.ts.
The payload format comes straight from the IndexNow protocol specification, which defines four required fields: host, key, keyLocation, and urlList.
CODE_BLOCK_0
Keep the key in an environment variable (INDEXNOW_KEY) rather than hardcoding it. The key itself isn't a secret, since it's publicly readable at your /public URL anyway, but keeping it in an env var means you can rotate it or reuse the handler across environments without editing source code. Next.js's App Router documentation covers the route handler conventions used here.
One detail worth building around from day one: a single call can batch up to 10,000 URLs per the IndexNow protocol. If you're submitting a handful of pages after a content update, you rarely need separate requests per page; batch them into one urlList array instead.
Trigger Submissions on Publish, Not on Every Build
The most common mistake is wiring this route handler into next build. Every deploy, even a dependency bump with zero content changes, would fire a submission for every URL on the site. That floods the IndexNow endpoint with redundant pings and makes your Bing Webmaster Tools reporting nearly impossible to read, since you can't tell a real content change from a routine deploy.
Trigger the submission on publish, not on build. In practice that means calling the route handler from one of these:
- A webhook from your CMS that fires on save or publish
- A server action that runs immediately after a content write succeeds
- A
revalidateTagcall, with the IndexNow submission added right next to it
IndexNow should map to "this page changed," not "I shipped code." Keep those two events separate even when they happen on the same afternoon.
If you're already building publish-triggered automations elsewhere in the business, this is the same shape. It's the identical pattern we use for other AI automation work: an event happens, a small handler fires, no human has to remember to click a button.
Confirm IndexNow Pings Are Landing in Bing Webmaster Tools
After your first test submission, check Bing Webmaster Tools within a day. It has a dedicated IndexNow section showing submitted URL counts and timestamps, so you can confirm pings are actually landing rather than silently failing. Bing's own documentation walks through where that reporting lives and what a successful submission looks like.
If the count stays at zero, check two things first: that the key file is reachable over HTTPS with no redirect in front of it, and that the host value in your payload matches the key file's domain exactly, including the www prefix if your site uses one.
A short paragraph worth remembering here: a 403 response or a key mismatch is by far the most common first-run failure. It's almost never a bug in the protocol itself; it's a mismatch between what your key file says and what your payload claims.
IndexNow vs Sitemap Submission vs Manual URL Inspection
None of these three methods replaces the other two. Here's how they actually compare:
| Method | Typical Discovery Time | Engines Covered | Effort to Maintain |
|---|---|---|---|
| IndexNow | Minutes | Bing, Yandex | Low, after initial setup |
| XML sitemap | Hours to days | All engines, including Google | Low |
| Google Search Console URL Inspection | Minutes | Google only | Manual, per URL |
A Next.js site aiming for fast, broad indexing should run all three: a sitemap for baseline coverage across every engine, IndexNow for instant Bing and Yandex discovery, and manual URL Inspection in Search Console for the handful of Google pages where you need confirmation now rather than later. For a deeper comparison of the first two methods specifically, see our breakdown of IndexNow vs sitemap submission.
Why Clean Technical SEO Still Decides Whether Pages Get Indexed
IndexNow speeds up discovery. It cannot fix a page that search engines refuse to index once they find it.
We saw this directly on one of our own technical audits: after cleaning up robots.txt, eliminating sitemap errors, and confirming every URL returned a 200 status instead of a stray 404 or redirect, 39 of 51 pages ended up submitted and indexed. Word count had nothing to do with closing that remaining gap; the other 12 pages needed internal-linking work before they'd index at all. Orphaned pages with no internal link pointing to them stayed invisible no matter how fast we pinged them.
That's the real lesson: IndexNow shortens the time between publish and discovery, but discovery isn't the same thing as indexing. If your robots.txt blocks a path, if a page carries an accidental noindex meta tag, or if nothing on your site links to it, pinging IndexNow just means the engine finds the blocked page faster.
Before you lean on IndexNow to solve an indexing problem, run this checklist:
- robots.txt allows crawling of the path in question
- The page returns a 200 status, not a 404 or an unexpected 301
- No accidental
noindexmeta tag is present in the page head - At least one internal link points to the page from elsewhere on the site
If you've worked through that list and pages still aren't indexing, the gap is bigger than a missing IndexNow key, and it's worth a full technical audit. That's the kind of structural work we cover in our web design engagements, alongside related fixes like schema markup and getting your site ready for llms.txt as AI crawlers join the mix too.
FAQ
Does IndexNow help a Next.js site get indexed by Google?
No. IndexNow is adopted by Bing, Yandex, and a handful of other engines, but Google does not currently consume IndexNow pings. For Google specifically you still need a clean XML sitemap, proper robots.txt, and Search Console submission; IndexNow only speeds up Bing and Yandex discovery.
Do I need a plugin to add IndexNow to a Next.js site?
No plugin is required. IndexNow only needs a key file hosted in your /public folder and a small route handler or server action that POSTs your URL list to the IndexNow API endpoint. The whole setup is typically under an hour of work for a developer already comfortable with the App Router.
How often should I submit URLs to IndexNow?
Submit only when a URL actually changes: on publish, on a significant content edit, or on deletion. Wiring the ping to your build process instead of your publish event floods the API with redundant submissions and makes your Bing Webmaster Tools reporting harder to read.
Can one IndexNow key cover multiple subdomains?
Generally no. The key file must be hosted at the root of the exact host you're submitting URLs for, so a separate key, or a copy of the key file, is typically needed per subdomain. Check the current IndexNow protocol documentation before assuming cross-subdomain coverage.
Your next step is concrete: generate the key, drop the .txt file in /public, and verify it loads before you write a single line of the route handler. Get that right first, since every failure downstream traces back to a key file that isn't actually reachable.
