This package provides a simple, event-driven integration for the IndexNow protocol in Symfony applications.
It allows you to notify search engines automatically when URLs change — by dispatching a Symfony event instead of handling API calls manually.
Search engines like Bing and Yandex support IndexNow, which allows pushing URL updates directly instead of waiting for crawlers.
In practice, this is often handled in an inconsistent way:
- manual API calls spread across the codebase
- delayed cronjobs
- missing notifications for certain changes
This package centralizes that logic.
Instead of triggering IndexNow manually, you dispatch an event — the notification is handled in one place.
This package is:
- a small, focused utility for Symfony applications
- event-driven and easy to integrate into existing workflows
- designed to solve one specific problem: notifying IndexNow endpoints
This package is not:
- a full SEO framework
- a crawler or indexing system
- a queue or background job system
- a complete search engine integration layer
It is intentionally minimal and does not try to cover every possible use case, even though the notifier supports a small built-in retry mechanism for transient HTTP failures.
Useful for applications where content changes frequently:
- Blogs / CMS systems
- E-Commerce platforms (products, categories)
- SEO-driven projects
- Headless backends
composer require thorsten/index-now-listenerINDEXNOW_KEY=your_indexnow_key
INDEXNOW_KEY_LOCATION=https://yourdomain.com/your_indexnow_key.txtINDEXNOW_KEY_LOCATION must be an absolute URL.
# config/services.yaml
Thorsten\IndexNowListener\Service\IndexNowNotifier:
arguments:
$key: '%env(INDEXNOW_KEY)%'
$keyLocation: '%env(INDEXNOW_KEY_LOCATION)%'
$searchEngine: !php/const Thorsten\IndexNowListener\Service\IndexNowNotifier::BING_ENDPOINT
$maxRetries: 2
$retryDelayMilliseconds: 250Important:
The IndexNowNotifier does not read environment variables directly.
All configuration must be provided via dependency injection.
use Thorsten\IndexNowListener\Event\IndexNowEvent;
$dispatcher->dispatch(new IndexNowEvent('https://yourdomain.com/page'));$dispatcher->dispatch(new IndexNowEvent([
'https://yourdomain.com/page1',
'https://yourdomain.com/page2',
]));Note: All URLs must belong to the same host.
use Thorsten\IndexNowListener\Service\IndexNowNotifier;
$notifier->notify([
'https://yourdomain.com/page1',
'https://yourdomain.com/page2',
]);Direct notifier usage applies the same safety checks as the event:
- every URL must be a valid absolute URL
- every URL must belong to the same host
keyLocationmust be a valid absolute URL- non-2xx responses raise an exception
- transient failures can be retried with the constructor options
For explicit HTTP failures, the notifier throws Thorsten\IndexNowListener\Exception\IndexNowNotificationException.
IndexNowNotifier::BING_ENDPOINTIndexNowNotifier::YANDEX_ENDPOINTIndexNowNotifier::INDEXNOW_ENDPOINT
- IndexNowEvent: Holds URLs
- IndexNowListener: Reacts to events
- IndexNowNotifier: Sends the HTTP request to the IndexNow API
The notifier is a pure service without hidden configuration logic.
- No global state (
$_ENV,$_SERVER) - No hidden configuration
- Explicit dependencies
- Fully testable
- PHP 8.2+
- Symfony HttpClient
- Symfony EventDispatcher (optional)
Supported package constraints:
php: ^8.2symfony/event-dispatcher: ^6.4|^7.0|^8.0symfony/http-client: ^6.4|^7.0|^8.0
- PHPUnit is configured via
phpunit.xml.dist - GitHub Actions runs
composer validate --strictand the test suite - SonarQube can import
phpunit-report.xmlandcoverage.xmlusingsonar-project.properties
Use it if:
- You care about SEO freshness
- Your content changes regularly
- You want a clean, event-driven solution
Don’t use it if:
- Your content rarely changes
- You don’t need fast indexing
Thorsten Baumann
https://baumann-it-dienstleistungen.de
info@baumann-it-dienstleistungen.de
This package is intentionally simple: no framework magic, no hidden behavior, just a clean way to integrate IndexNow into Symfony.