Repository navigation
Submit changed pages to Bing with IndexNow after each production deploy - #39
Merged
Merged
Conversation
Bing Webmaster Tools lists IndexNow as its top recommendation for the site, and 20 of its 27 pages are still waiting to be crawled. The key lives in siteConfig and is served from public/ as IndexNow requires. scripts/indexnow.mjs reads the sitemap and submits the pages whose lastmod falls in the last seven days, or every page with --all; --dry-run prints the payload instead of sending it.
Runs scripts/indexnow.mjs when Vercel reports a successful Production deployment, so pages changed in the last week reach Bing without waiting for a crawl. A manual run with "all" submits every page in the sitemap, for the first seeding or after a large change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Tells Bing about changed pages right after each production deploy, using IndexNow:
siteConfig.indexNowKey, served at/f45f7e891bc3827c5178c9ff112a900c.txtas the protocol requires. Thekey is public by design.
scripts/indexnow.mjs: reads the live sitemap and submits the pages whoselastmodfalls in the last sevendays.
--allsubmits every page and--dry-runprints the payload instead of sending it. No dependencies (Node 22fetch)..github/workflows/indexnow.yml: runs the script when Vercel reports a successful Production deployment. Itcan also be started by hand from the Actions tab, with an
allswitch.the key file matches the config.
Why: setting up IndexNow is Bing Webmaster Tools' top recommendation for the site, and Bing already shows the site
more often than Google does (740 vs 676 impressions last month). Bing's index also feeds DuckDuckGo, Copilot and
ChatGPT search, and IndexNow is shared with Yandex, Seznam and Naver. Google doesn't use it.
How I checked it
npm run lintnpm test(119 passing)npm run buildOn a local production build:
/f45f7e891bc3827c5178c9ff112a900c.txtis served astext/plainand contains just the key.node scripts/indexnow.mjs --dry-run --all http://localhost:3100builds a payload with all 27 sitemap URLs onvisualizer-gold.vercel.app, with the rightkeyLocation.mainreports nothing to submit, because no page changed in the last seven days.The workflow can only run for real after this is merged.
After merging
gh workflow run indexnow.yml -f all=true.IndexNow accepted 27 URLs (200)or(202), then look at Bing Webmaster Tools →IndexNow the next day.