Index Now
Automatically submits URLs to search engines when content is created, updated, or deleted on your Drupal website using the IndexNow protocol.
index_now
Install
composer require 'drupal/index_now:^3.1'
composer require 'drupal/index_now:^2.0'
Overview
The Index Now module implements the IndexNow protocol, which allows website owners to notify search engines instantly when content changes occur. This eliminates the wait for search engine crawlers to discover changes naturally.
When nodes or taxonomy terms are created, updated, or deleted, the module automatically sends an HTTP request to the configured search engine's IndexNow endpoint. Since November 2021, all compatible search engines share submitted URLs with each other, so notifying one engine effectively notifies all participating engines simultaneously.
The module supports seven search engines: Amazon, Microsoft Bing, IndexNow (generic), Naver, Seznam.cz, Yandex, and Yep. It provides fine-grained control over which content types and taxonomy vocabularies trigger indexing requests, and which events (create, update, delete) should be processed.
For security and domain verification, the module generates a unique UUID-based API key that search engines use to verify site ownership before processing indexing requests.
Features
- Automatic URL submission to search engines when nodes are created, updated, or deleted
- Automatic URL submission to search engines when taxonomy terms are created, updated, or deleted
- Support for seven major search engines: Amazon, Microsoft Bing, IndexNow, Naver, Seznam.cz, Yandex, and Yep
- UUID-based API key generation for search engine domain verification
- Exclude specific content types from indexing
- Exclude specific taxonomy vocabularies from indexing
- Exclude specific events (insert, update, delete) from triggering indexing
- Path alias support - triggers indexing when new path aliases are created
- Multilingual support - respects entity language when building URLs
- Access control - only indexes content accessible to anonymous users
- Programmatic API service for custom URL submission
- Verbose logging mode for debugging and monitoring
- Drush command for API key regeneration
Use Cases
Immediate Search Engine Indexing for News Sites
News websites that frequently publish time-sensitive content can use Index Now to ensure new articles appear in search results within minutes rather than waiting for search engine crawlers. When an editor publishes a breaking news story, the URL is immediately submitted to all major search engines.
E-commerce Product Updates
Online stores with frequently changing inventory or pricing can use Index Now (combined with Index Now Commerce module) to notify search engines of product updates, ensuring accurate information appears in shopping search results.
Content Migration Notification
When restructuring a website or migrating content, Index Now ensures that updated URLs and deleted content are promptly reflected in search engine indexes, preventing broken links in search results.
Selective Indexing by Content Type
A website may want to immediately index public-facing content types like articles and news but exclude internal content types like staff profiles or internal announcements. The exclusion settings allow fine-grained control over which content triggers indexing.
Custom URL Indexing via API
Developers can use the IndexNow service programmatically to submit URLs that are not standard nodes or taxonomy terms, such as custom routes or external page generators: \Drupal::service('index_now.indexnow')->sendRequest($custom_url);
Tips
- Use Config Split to ensure Index Now is only active on your production environment - search engines cannot crawl localhost or staging servers
- Enable verbose mode during initial setup to verify that indexing requests are being sent successfully, then disable it to reduce log noise
- Since all IndexNow-compatible search engines share URLs since November 2021, you only need to select one search engine as they will all receive the notification
- For multilingual sites, Index Now automatically respects entity language and submits the correct language-specific URL
- Content must be accessible to anonymous users to be indexed - the module automatically skips content that anonymous users cannot view
- Use the API service for custom implementations: \Drupal::service('index_now.indexnow')->sendRequest($url);
- Consider excluding 'insert' events if you want content to be reviewed before search engines are notified - updates will still trigger indexing
Technical Details
Admin Pages 1
/admin/config/services/index_now
Configure the Index Now module settings including search engine selection, content type exclusions, taxonomy exclusions, and logging options. The API key status is displayed and can be generated from this page if missing.
Permissions 1
Hooks 5
hook_ENTITY_TYPE_insert (path_alias)
Triggered when a new path alias is created. Calls PathAliasOperations to trigger indexing for the underlying entity.
hook_ENTITY_TYPE_update (node)
Triggered when a node is updated. Sends an indexing request to search engines for the updated node.
hook_ENTITY_TYPE_delete (node)
Triggered when a node is deleted. Notifies search engines that the URL should be removed from the index.
hook_ENTITY_TYPE_update (taxonomy_term)
Triggered when a taxonomy term is updated. Sends an indexing request to search engines for the updated term.
hook_ENTITY_TYPE_delete (taxonomy_term)
Triggered when a taxonomy term is deleted. Notifies search engines that the URL should be removed from the index.
Drush Commands 1
drush index_now:keygenerate
Generates a new UUID-based API key for Index Now domain verification. The new key is stored in configuration and displayed in the output.
Troubleshooting 6
Verify that the API key has been generated by visiting /admin/config/services/index_now. If no key exists, click 'Generate the API key' or run 'drush index_now:keygenerate'. Also ensure the module is only enabled on production (not staging/local).
Verify that the API key file is accessible by visiting /index_now_api_key_{YOUR_API_KEY}.txt in a browser (replace with your actual UUID key). The page should return the API key as plain text.
Check the settings at /admin/config/services/index_now to ensure the content type is not in the exclusion list. Also verify that the 'Entity created' event is not excluded if new content should trigger indexing.
Enable 'Verbose mode' in the Index Now settings. By default, only errors and warnings are logged. With verbose mode enabled, successful indexing requests will also be logged.
The module automatically checks if content is accessible to anonymous users before submitting for indexing. If private content is being indexed, review your content permissions to ensure anonymous users cannot view the content.
Run 'drush index_now:keygenerate' to generate a new API key, or generate it from the admin settings page.
Security Notes 4
- The API key is stored in configuration and exposed via a public URL path for search engine verification - this is by design and required by the IndexNow protocol
- The 'configure index now' permission is marked as 'restrict access' and should only be granted to trusted administrators
- The module only indexes content accessible to anonymous users, preventing accidental exposure of private content to search engines
- The API key verification endpoint is publicly accessible by design, as search engines need to verify domain ownership before accepting indexing requests