IndexNow
IndexNow lets you instantly notify search engines (Bing, Yandex, and others) when pages are added or updated. Instead of waiting days for crawlers to find changes, they’re indexed within hours.
How it works
Section titled “How it works”- You generate a secret key
- You place a verification file at
https://domain.com/<key>.txt - After deploying, you POST your updated URLs to
api.indexnow.orgalong with the key - All participating search engines receive the submission simultaneously
Setup (already done in the Juju Alpha template)
Section titled “Setup (already done in the Juju Alpha template)”1. Key file
Section titled “1. Key file”A file named <key>.txt lives in public/ and contains just the key:
205d1dc34cbc4ab0d6410fb0d5b96745Accessible at: https://domain.com/205d1dc34cbc4ab0d6410fb0d5b96745.txt
2. Meta tag in layout
Section titled “2. Meta tag in layout”<meta name="indexnow-key" content="205d1dc34cbc4ab0d6410fb0d5b96745" />3. Submit script (scripts/indexnow.mjs)
Section titled “3. Submit script (scripts/indexnow.mjs)”Reads the sitemap, filters out noindex pages, and POSTs all URLs to IndexNow:
npm run indexnowFor a new client site
Section titled “For a new client site”Generate a new key (don’t reuse the Juju Alpha key):
node -e "const c='abcdef0123456789';let k='';for(let i=0;i<32;i++)k+=c[Math.floor(Math.random()*c.length)];console.log(k)"Then:
- Create
public/<new-key>.txtwith the key as content - Update the
meta name="indexnow-key"in Layout.astro - Update
KEYandKEY_LOCATIONinscripts/indexnow.mjs - Update
HOSTandSITEMAP_URLinscripts/indexnow.mjs
When to run it
Section titled “When to run it”Run npm run indexnow after every deploy that changes public content:
- New blog post published
- Service page updated
- New page added
- Pricing changed
No need to run it for checkout/payment-return/thank-you page changes - those are noindex and filtered out by the script.
API response codes
Section titled “API response codes”| Code | Meaning |
|---|---|
| 200 | OK - URLs accepted |
| 202 | Accepted - queued for processing |
| 400 | Bad request - check URL format |
| 403 | Forbidden - key mismatch |
| 422 | Unprocessable - invalid URLs |
| 429 | Too many requests - slow down |