Menu

Submitting URLs to IndexNow from PHP: getting Bing and Yandex to notice new pages in hours
πŸ“°

Submitting URLs to IndexNow from PHP: getting Bing and Yandex to notice new pages in hours

DEV Community: phpΒ·Mobeen AhmedΒ·12 days ago
#IYOyMA7t
#devto#dev#indexnow#urls#file
Reading 0:00
15s threshold

Google has Search Console for submitting new pages, but Bing and Yandex have something simpler: IndexNow. You make one HTTP request naming a URL, and both search engines pick it up β€” usually within hours. No dashboard, no per-URL form, just a POST with a key. For a small tool site where I publish new pages in batches, it is the fastest way I know to get noticed.

The protocol is refreshingly primitive. First you generate a random key β€” a 32-character hex string is fine β€” and put it in a text file at the root of your site, e.g. https://example.com/2f8a1c...txt , with the key as the file's only content. That file is your proof of ownership. Then every time you have new or changed URLs, you POST a JSON payload to https://api.indexnow.org/indexnow :

function indexnow_submit ( $urls ) { $key = trim ( file_get_contents ( __DIR__ . '/indexnow-key.txt' )); $host = 'www.ramrom.io' ; $payload = json_encode ([ 'host' => $host , 'key' => $key , 'keyLocation' => 'https://' . $host . '/' . $key .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.