sylius-indexnow — new products in the index within minutes.
A new product waits until a crawler happens to come by. sylius-indexnow tells search engines through IndexNow which products, taxons and homepages were added, changed or removed. Bing, Yandex, Seznam, Naver, Yep and Amazon share every submission. Bing's index feeds ChatGPT search and Copilot.
- Composer package:
koh/sylius-indexnow - Built on:koh/indexnow, the framework-agnostic client
- Sylius: 2 · PHP: 8.3+ · MIT · source on GitHub
TL;DR — Does this fit my setup?
Use it if
- new products or categories should appear quickly in Bing and the AI search engines
- several channels run on their own hostnames
- test systems must never submit anything
Do not use it if
- no worker can run from cron or a CronJob:
koh:indexnow:runsends the submissions - you want to reach Google, which does not take part in IndexNow
- you run Sylius 1 or PHP < 8.3
Effort
One Composer package, one entry in bundles.php, one route, one migration. No key to generate, no file to upload.
Installation and activation
composer require koh/sylius-indexnow
// config/bundles.php
Koh\IndexNow\Sylius\KohIndexNowSyliusBundle::class => ['all' => true],
# config/routes/koh_indexnow.yaml – the key file, at the origin root
koh_indexnow:
resource: '@KohIndexNowSyliusBundle/config/routes.php'
bin/console doctrine:migrations:migrate # two small tables, shipped with the bundle
Then run the worker every few minutes, from cron or a Kubernetes CronJob:
bin/console koh:indexnow:run
That is the whole setup. Every enabled channel announces on its hostname.
- Key per host: derived from
kernel.secret(HMAC-SHA256). Nothing to store, identical on every replica, different for every host. - Key file: the bundle's route serves it at
/<key>.txt. - Go-live: the first run with an active host announces the whole catalogue once. A database row remembers it, so redeploys and new pods do not announce everything again.
What gets announced
| Change | Announced |
|---|---|
| A product, its translation, variant, price, image or taxon assignment | The product page in every channel it belongs to and every channel locale it has a slug in, plus its main taxon's listing if that taxon is enabled |
| A taxon or its translation | The taxon page in every channel whose menu tree contains it |
| A product or taxon is deleted | Its URLs, resolved before the deletion, if it was enabled |
| The go-live | Homepages, enabled products and enabled taxons |
Changes come from Doctrine, so the admin, imports, the API and fixtures are all covered. Disabling a product is announced, because the engine has to re-crawl to learn it is gone. A product that was never public stays silent until it is enabled.
What is never announced
A submission cannot be recalled, and every participating engine receives it. So only the prod kernel environment sends anything. That is not configurable.
The library's host policy checks hosts. It refuses .localhost, .test, .invalid, .internal, IP addresses and hosts with a dev, staging or preview label. shop.dev.example.com stays silent even in prod. On a host that does not announce, the key file does not exist either.
Delivery and configuration
Changes are queued in koh_indexnow_queue and sent by koh:indexnow:run, one request per host. Accepted rows are removed. 429, 5xx, network errors and 403 (key file not reachable yet) wait with exponential backoff from one minute to six hours, honouring Retry-After, and are given up after eight attempts. 400 and 422 are removed and logged, and the command exits with status 1.
There is deliberately no Messenger message: a queue without a consumer loses messages, and a synchronous transport would put a search engine's latency into the admin's save.
Commands
bin/console koh:indexnow:status # per channel host: active or why not, key file URL, queue
bin/console koh:indexnow:run # the worker
bin/console koh:indexnow:submit-all # queue the catalogue again
Configuration
Everything is optional.
koh_indexnow:
enabled: true
key: '' # empty: derived per host from kernel.secret
channels: [] # channel codes; empty: all enabled channels
denied_host_suffixes: [] # further hosts never announced
include_homepage: true
include_main_taxon: trueGetting new products into the index?
If new products take days before Bing and the AI search engines know them, sylius-indexnow helps. Talk to me about the setup or monitoring the submissions.
Or email me directly: mail@ole-hartwig.eu