indexnow-batch: batched IndexNow pings for WordPress

A WordPress plugin that tells IndexNow search engines about new and updated pages in scheduled batches, never on the publish path, and re-checks every URL at send time.

indexnow-batch is a WordPress plugin that tells IndexNow search engines (Bing, Yandex, Naver, Seznam and others) about new and updated pages. It sends in batches, on a schedule, never on the publish path. It is for site operators who publish a lot and want control over what gets announced. The code is at https://github.com/IndianOpinion/indexnow-batch, under the MIT licence. Version v0.1.0 was released on 14 November 2026.

The problem

Done naively, IndexNow goes wrong in five ways:

  • One request per publish. A busy news site makes thousands of HTTP calls a day, slows the publish path and gets rate limited.
  • It announces pages that should not be indexed: drafts, private posts, password-protected posts, withdrawn pages, redirects and noindexed pages. Telling a search engine to crawl a page you marked noindex undoes the noindex in one request.
  • The queue goes stale. A URL is valid when queued, but the post may be drafted, withdrawn or marked noindex before the batch goes out. Only a check at send time is correct.
  • It ignores the site’s own visibility. A staging copy, or a site with “Discourage search engines” ticked, still pings the engines.
  • Failures are silent. Cron output goes nowhere, so a refused batch or a bad key leaves no trace, and a refused batch is retried forever.

Google does not take part in IndexNow, and this plugin does not call Google.

What it does

  • Queues a URL when a post moves into publish, with no HTTP request on that path.
  • Re-checks every queued URL at send time against the core WordPress rules and one filter of your own, and drops what fails.
  • Sends batches of up to 10,000 URLs on a schedule (every 15 minutes by default), with site-wide back-off driven by the response code.
  • Generates and serves the IndexNow key file from PHP, with no rewrite rule, and verifies it from the site itself.
  • Records one run record per flush and offers wp indexnow commands for status, queue, flush, key, log and pause.

How it works

The queue is a custom table. Each row holds the URL and the post ID, so the flush always works from the post as it is now. Queue\Enqueuer applies the rules at publish time. Flush\Flusher runs the flush under one lock, which is a row in the options table. Flush\Submitter builds the payload, Flush\Backoff handles back-off and the 403 hold, and Key\KeyManager and Key\KeyFileHandler deal with the key.

A flush does the following. It removes old rows. It stops, keeping the queue, when the site discourages search engines, the environment is not production, sending is disabled, the key is malformed or it is backing off. It checks the key file from the site itself. It then takes due rows oldest first, reloads each post, recomputes its permalink and re-applies every rule. Finally it posts the batch to the endpoint.

The response decides what happens next. A 200 or 202 marks rows sent. A 429, 5xx or timeout keeps the rows and backs off site-wide, from 15 minutes doubling up to 6 hours, or by Retry-After. A 403 holds everything until the key file verifies again. A 400 or 422 batch is halved and each half retried once, and rows refused again are marked failed with the code.

Your own index rules go in one filter, called at enqueue and again before send:

add_filter('indexnow_batch_should_submit', function (bool $submit, string $url, ?WP_Post $post, string $context): bool {
    if ($post && get_post_meta($post->ID, '_yoast_wpseo_meta-robots-noindex', true) === '1') {
        return false;
    }
    return $submit;
}, 10, 4);

The plugin does not read any SEO plugin’s settings itself. Typical commands are wp indexnow status, wp indexnow flush --dry-run and wp indexnow key verify.

Guard rails

  • Nothing is sent while “Discourage search engines” is ticked or while wp_get_environment_type() is not production. URLs keep queueing, bounded by age (7 days by default) and a cap (10,000), and are re-checked when sends start.
  • A filter that throws refuses that URL and logs the message once.
  • Only URLs on the site’s own home host and path are sent. Raw URLs that resolve to a post with a different permalink are dropped as ambiguous.
  • TLS verification is forced on and redirects are off, even after the request-args filter. The endpoint must be https.
  • One flush runs at a time, and rows are moved by ID only, so a URL queued during a send is not lost.
  • The table is verified with SHOW COLUMNS and SHOW INDEX after dbDelta. A missing column refuses queueing and makes the flush return schema_error, because dbDelta has silently skipped column adds before.
  • wp indexnow pause covers bulk imports, and INDEXNOW_BATCH_DISABLE keeps queueing but never sends.
  • Uninstall removes the table, options, schedule and a key file only if the plugin wrote it.

What review changed

We cannot report review defects for this repo. The review comment posted on its build PR describes a different project (a query cache), so it does not apply here, and we have not used it. What the tests cover instead: the build PR records 147 PHPUnit tests (569 assertions), with acceptance tests named after the PRD’s case numbers, and PHPStan level 8 and phpcs clean. Behaviour tests run against an in-memory queue repository. A separate test checks the SQL the real repository issues against a recording wpdb.

Limits and what is next

  • It announces live pages only. Removals (trash, 410) are not announced in 0.1.0.
  • One endpoint receives each batch, and participating engines share submissions.
  • Category and author archives are queued only if you turn on the indexnow_batch_include_archives filter.
  • Nothing has run against a live MySQL. Issue 6 asks for a Docker-based integration suite for 0.2.
  • Issue 5 is open: removing a deleted subsite’s queue rows from the shared table on multisite.
  • If the site cannot fetch itself, key verification is unknown and sends proceed with a daily warning.

Test status: this is v0.1.0. Tests run on stubs of WordPress, wpdb and WP-CLI, not on a real WordPress. CI has not yet run on GitHub, and the plugin has not run on a live site. The 15-minute batching and the send-time re-check are design behaviours checked by tests, not figures from a live site that we publish here.

Install

Requires PHP 8.1 or later and WordPress 6.4 or later, with no runtime dependencies.

The package is not on Packagist yet, so first add a Composer vcs repository entry for https://github.com/IndianOpinion/indexnow-batch.

composer require indianopinion/indexnow-batch

Without Composer, unzip a release into wp-content/plugins/indexnow-batch/ and activate it. It also works as a must-use plugin with the loader in examples/mu-loader.php, and then creates its table, key and schedule on the first init.

All 47 utilities · indexnow-batch on GitHub

Search Trending
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...

All fields are required.