Kai Ole Hartwig
New content in the index sooner?

koh/indexnow — notifying search engines, without a framework.

A new link waits until a crawler happens to come by. With IndexNow you tell search engines yourself which URL is new, changed or removed. Bing, Yandex, Seznam, Naver, Yep and Amazon share every submission. Bing's index feeds ChatGPT search and Copilot.

  • Composer package:koh/indexnow
  • Integrations:typo3-indexnow and sylius-indexnow
  • PHP: 8.3+ · MIT · source on GitHub

TL;DR — Does this fit my setup?

Use it if

Do not use it if

Effort

One Composer package, one PSR-18 client, three lines of code. No configuration file, no global state.

What the package takes care of

TaskHow
KeysKey::derive() computes a stable per-host key from an application secret (HMAC-SHA256). Nothing to store, identical on every replica, different for every host.
Hosts that are never announcedHostPolicy refuses IP addresses, single-label names, .localhost, .test, .invalid, .internal, .local and hosts with dev, staging or preview. The check runs inside the client, before any network access.
Valid submissionsSame host, http and https only, no credentials, no fragments. Duplicates are removed, lists over 10,000 URLs are split.
Outcomes a queue can act onEvery response becomes an Outcome with isRetryable(): 429, 5xx, transport errors and 403 are retryable, 400 and 422 are not. Retry-After is parsed and capped.
No leaksThe key appears neither in exception messages nor in log excerpts.

Usage

use Koh\IndexNow\IndexNowClient;
use Koh\IndexNow\Key;
use Koh\IndexNow\Submission;

$key = Key::derive($applicationSecret, 'www.example.org');
// Serve $key->value as text/plain at www.example.org/{$key->fileName()}

$client = new IndexNowClient($psr18Client, $psr17RequestFactory, $psr17StreamFactory);
$submission = Submission::forHost('www.example.org', $key, [
    'https://www.example.org/news/launch',
]);

foreach ($client->submitAll($submission) as $result) {
    if ($result->isRetryable()) {
        // queue again, after $result->retryAfterSeconds if the engine said so
    }
}

 

Give your PSR-18 client a short timeout of five to ten seconds and do not let it follow redirects: the request body carries the key.

The default endpoint is api.indexnow.org/indexnow. Other endpoints must use HTTPS and belong to a known participant. That guards against a typo in the configuration sending the key to someone else's domain.

Limits

Next step

Bring IndexNow into your application?

If new URLs take days before Bing and the AI search engines know them, koh/indexnow helps. Talk to me about the integration or monitoring the submissions.

Discuss the integration →

Or email me directly: mail@ole-hartwig.eu