DEV Community

Cover image for Quickly index these web pages with IndexNow
Thomas Bnt
Thomas Bnt Subscriber

Posted on • Originally published at thomasbnt.dev

Quickly index these web pages with IndexNow

Introduction

IndexNow is a protocol for rapidly indexing web pages on search engines. It was created by Bing and Yandex, and is now an open-source project.
Created in 2021, it is now supported by several search engines, including Bing, Yandex, Seznam, Naver and Yep.

How does it work?

The IndexNow protocol is based on the Ping protocol, which notifies search engines when a new article is published. IndexNow goes one step further, notifying search engines when a web page is updated.

To use IndexNow, simply send an HTTP POST request to the URL https://www.bing.com/indexnow (or any other search engine with an /indexnow API):

POST https://www.bing.com/indexnow HTTP/1.1
Content-Type: application/json; charset=utf-8
Enter fullscreen mode Exit fullscreen mode
{
  "host": "thomasbnt.dev",
  "key": "0e11834b62ad4f089b83b91666a61105",
  "keyLocation": "https://thomasbnt.dev/0e11834b62ad4f089b83b91666a61105.txt",
  "urlList": [
    "https://thomasbnt.dev/about",
    "https://thomasbnt.dev/blog",
    "https://thomasbnt.dev/uses",
    "https://thomasbnt.dev/contact",
    "https://thomasbnt.dev/terms"
  ]
}
Enter fullscreen mode Exit fullscreen mode

Fields description

  • host : the domain name of the website.
  • key: the public key generated for the website.
  • keyLocation: the URL of the public key.
  • urlList : the list of URLs to be indexed.

See the list of search engines supporting IndexNow →

Why use IndexNow?

IndexNow enables rapid indexing of web pages on search engines, which can be useful for websites that frequently publish content. This helps to improve the visibility of web pages on search engines and attract more traffic.

Implement IndexNow on my website

To implement IndexNow on your website, you can use a plugin like IndexNow WordPress Plugin, or send HTTP requests manually.
There are also hosting providers that support IndexNow, such as Cloudflare, WordPress.com, Shopify, etc. You can find the list directly on the site.

The various solutions available for implementing IndexNow on your website, such as WordPress, Cloudflare, Shopify, etc.

Let's go step by step

  1. Generate a public key and add it to your public/ folder on your website, this will create a link like this https://thomasbnt.dev/0e11834b62ad4f089b83b91666a61105.txt (here 0e11834b62ad4f089b83b91666a61105 is the public key). Generate a public key to use IndexNow
  2. Update your website with the key, or use a plugin that will do it for you.
  3. Send an HTTP POST request to the IndexNow API URL of the search engine you wish to use, with the public key and the list of URLs to be indexed. In this case, we're using Bing.
POST https://www.bing.com/indexnow HTTP/1.1
Content-Type: application/json; charset=utf-8
Enter fullscreen mode Exit fullscreen mode

The request body should look like this:

{
  "host": "thomasbnt.dev",
  "key": "0e11834b62ad4f089b83b91666a61105",
  "keyLocation": "https://thomasbnt.dev/0e11834b62ad4f089b83b91666a61105.txt",
  "urlList": [
      "https://thomasbnt.dev/about",
      "https://thomasbnt.dev/blog",
      "https://thomasbnt.dev/uses",
      "https://thomasbnt.dev/contact",
      "https://thomasbnt.dev/terms"
  ]
}
Enter fullscreen mode Exit fullscreen mode
  1. You should receive a 200 OK response if the request was successfully sent. 200 OK response from IndexNow request with HTTPie as HTTP client Note: I use the HTTP client HTTPie to send HTTP requests.
  2. Check that the pages have been indexed by consulting your website logs or by using search engine tools such as Bing's Bing Webmaster Tools. Bing search tool for checking web page indexing
  3. Congratulations, your web pages are now quickly indexed on search engines! 🎉

Useful links

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.