Content Revalidation Tracker

By Dropndot Solutions

★ 5.0/5 (2 ratings)10+ active installationsVersion 2.1.0

Keep your headless frontend fresh. Revalidates Next.js (on-demand ISR), Nuxt or any frontend when posts, pages, terms or authors change.

Description

Content Revalidation Tracker connects headless WordPress to your frontend. When content changes, the plugin sends a secure request to your frontend’s revalidation endpoint, so the affected pages are rebuilt right away and visitors never see stale content.

It works with Next.js on-demand ISR, Nuxt, Astro, Gatsby or any framework that can expose an API route.

How it works

  1. You publish, update, unpublish, trash or delete a post, page, term or author.
  2. The plugin works out the frontend path using your URL mapping (for example /blog/my-post/).
  3. It sends POST https://your-frontend.com/api/revalidate?path=/blog/my-post/ with the secret in the X-Revalidate-Secret header.
  4. Your frontend revalidates the page. If the request fails, the plugin retries it in the background.

Features

  • Automatic revalidation for posts, pages, custom post types, categories, tags, custom taxonomies and author archives.
  • Slug changes handled: both the old and the new URL are revalidated.
  • URL mapping: match your frontend routes with per post type, per taxonomy and author archive prefixes, with a live preview of the resulting path.
  • Secure by default: the secret is sent in a request header, never stored in the activity log, and masked on the settings page. A secret generator is built in.
  • Fast for editors: requests are sent after the editor’s response is finished, so saving a post is never slowed down.
  • Reliable: timeouts, rate limits and server errors are retried in the background through WP-Cron.
  • Built for bulk changes: bulk edits, imports and WP-CLI loops are sent in parallel (10 at a time) with a retry queue of up to 5,000 paths.
  • Test tool: send a real revalidation request for any path and see the response.
  • Activity log: see the HTTP status of recent requests, filter by success, failure or retry, and search by path.
  • Developer friendly: filters for allowed post types, taxonomies, prefixes, timeouts and concurrency.
  • Clean uninstall: deleting the plugin removes all of its data, including on multisite.

Who it is for

  • Headless WordPress sites with a Next.js, Nuxt, Astro or Gatsby frontend.
  • Sites that use static generation or incremental static regeneration and need fresh pages without full rebuilds.
  • Agencies that want a simple, reliable link between editors and the frontend.

Frontend endpoint example (Next.js App Router)

Create app/api/revalidate/route.ts on your frontend. Keep the secret in a server-only environment variable such as REVALIDATE_SECRET, never in a NEXT_PUBLIC_ variable.

import { revalidatePath } from 'next/cache';
import { timingSafeEqual } from 'node:crypto';

const SECRET = process.env.REVALIDATE_SECRET ?? '';
const ALLOW_LEGACY = process.env.ALLOW_LEGACY_QUERY_SECRET === 'true';

function matches(value: string | null): boolean {
  if (!value || !SECRET) return false;
  const a = Buffer.from(value), b = Buffer.from(SECRET);
  return a.length === b.length && timingSafeEqual(a, b);
}

export async function POST(req: Request) {
  const url = new URL(req.url);
  const ok = matches(req.headers.get('x-revalidate-secret'))
    || (ALLOW_LEGACY && matches(url.searchParams.get('secret')));
  if (!ok) return Response.json({ message: 'Invalid secret' }, { status: 401 });
  const path = url.searchParams.get('path');
  if (!path) return Response.json({ message: 'Missing path' }, { status: 400 });
  revalidatePath(path);
  return Response.json({ revalidated: true, path });
}


ALLOW_LEGACY_QUERY_SECRET is only needed while migrating from the old `?secret=` query parameter. New sites can leave it unset.

Developer filters

  • content_revalidation_tracker_allowed_post_types: limit which post types are revalidated.
  • content_revalidation_tracker_allowed_taxonomies: limit which taxonomies are revalidated.
  • content_revalidation_tracker_author_prefix: change the author archive prefix.
  • content_revalidation_tracker_request_timeout: request timeout in seconds (default 10).
  • content_revalidation_tracker_concurrency: parallel requests per run (default 10).
  • content_revalidation_tracker_batch_time_limit: time budget per run in seconds (default 30).
  • content_revalidation_tracker_retry_queue_limit: maximum paths in the retry queue (default 5,000).

Installation

  1. In WordPress, go to Plugins → Add New, search for “Content Revalidation Tracker”, then click Install Now and Activate. You can also upload the content-revalidation-tracker folder to /wp-content/plugins/.
  2. Go to Settings → Content Revalidation.
  3. On the Connection tab, enter your Frontend Domain (for example https://example.com) and a Secret Key. Use Generate to create a strong secret, then add the same value to your frontend as REVALIDATE_SECRET.
  4. Add the /api/revalidate endpoint to your frontend (see the example in the Description).
  5. Optional: on the URL Mapping tab, set prefixes so paths match your frontend routes.
  6. Click Test Path to confirm your frontend accepts the request.

FAQ

Which frontends are supported?

Any frontend that can receive a POST request and refresh a page: Next.js (on-demand ISR), Nuxt, Astro, Gatsby, SvelteKit or a custom server.

What does my frontend need?

An endpoint at /api/revalidate that accepts POST requests. The path to refresh is sent in the path query parameter and the secret in the X-Revalidate-Secret header. Compare the secret in constant time, as in the example in the Description.

Does it work with custom post types and taxonomies?

Yes. All public post types and taxonomies are included automatically. Set their frontend prefixes on the URL Mapping tab, and limit them with the content_revalidation_tracker_allowed_post_types and content_revalidation_tracker_allowed_taxonomies filters.

Can I change the author archive URL?

Yes. By default author pages are revalidated at /author/[nicename]/. Set an Author Archive Prefix on the URL Mapping tab (for example team gives /team/[nicename]/), or use the content_revalidation_tracker_author_prefix filter.

What happens when my frontend is down or slow?

Each request waits up to 10 seconds. Connection errors, timeouts, HTTP 408, 425, 429 and 5xx responses are retried in the background through WP-Cron, up to 3 attempts. Errors such as 401, 403 or 404 point to a configuration problem and are not retried. Every result is shown on the Activity tab.

Does it handle large sites and bulk actions?

Yes. Each change only sends requests for the affected URLs, so site size does not matter. Bulk actions, imports and WP-CLI loops are sent in parallel, 10 at a time, within a 30-second budget per run. Paths that do not fit wait in the retry queue (up to 5,000 paths) and are sent by WP-Cron. If your frontend cannot handle parallel requests, set the content_revalidation_tracker_concurrency filter to 1.

Do I need WP-Cron?

Only for retries. The first request is sent at the end of the request that changed the content. If DISABLE_WP_CRON is set, make sure a real cron job calls wp-cron.php.

Is the secret sent securely?

The secret is sent in the X-Revalidate-Secret header, so use HTTPS. A domain entered without a scheme defaults to https://. The plugin never writes the secret to the activity log, admin notices or the debug log, and masks it on the settings page.

How do I migrate from the old ?secret= query parameter?

Sites upgraded from an earlier version are switched to Header + legacy query parameter mode, which sends the secret in both places, so nothing breaks. To migrate without downtime:

  1. Update your frontend to accept the X-Revalidate-Secret header while still accepting ?secret= (set ALLOW_LEGACY_QUERY_SECRET=true in the example above) and deploy.
  2. In WordPress, open Settings → Content Revalidation → Connection, tick Test header-only authentication and click Test Path. This does not change the live setting.
  3. When the test succeeds, set Authentication method to Header only and save.
  4. Remove the query parameter check from your frontend (ALLOW_LEGACY_QUERY_SECRET=false) and deploy.
  5. Rotate the secret, because it used to appear in URLs and may be in old access logs.

When will query parameter authentication be removed?

Version 2.2.0 (at least 90 days after 2.1.0) will show the deprecation warning on the Dashboard and Plugins screens. Version 3.0.0 (at least 180 days after 2.1.0) will remove it, and the secret will be sent only in the header.

Can I trigger revalidation manually?

Yes. Enter any path on the Connection tab and click Test Path.

Does it work with caching plugins?

Yes. The plugin only tells your frontend which pages to refresh, so it works alongside page and object caching plugins.

What is removed on uninstall?

All settings, the activity log and the retry queue, on every site of a multisite network.

Screenshots

Changelog

2.1.0

Security

  • The secret is now sent in the X-Revalidate-Secret header. Existing sites switch to a compatibility mode that also sends ?secret=; new installs use the header only. See the FAQ to migrate.
  • The secret is no longer stored in the activity log (existing entries are cleaned on upgrade) and is masked on the settings page. Error messages and response bodies are redacted.
  • The secret field is now a password field, and the help text no longer suggests a NEXT_PUBLIC_ variable.
  • A domain entered without a scheme defaults to https://. Domains with a query string or fragment are rejected, and prefix inputs are validated.

Added

  • Redesigned settings page with Overview, Connection, URL Mapping, Activity and System tabs, live field validation, secret generator, copy buttons, a filterable activity log, and “Retry now” and “Clear log” actions.
  • Parallel requests (10 at a time, filter content_revalidation_tracker_concurrency), so bulk actions of hundreds of posts finish in one run.
  • Author archive prefix on the URL Mapping tab, plus the content_revalidation_tracker_author_prefix filter.
  • Uninstall removes all plugin data.

Fixed

  • Unpublishing (draft, pending, private) now revalidates the page.
  • Trashing no longer sends a request for a /slug__trashed/ path, and deleting from the trash no longer sends a request.
  • Deleting a category, tag or other term now revalidates its page.
  • Slug changes revalidate both the old and the new URL for posts, terms and authors.
  • Path and secret are URL-encoded correctly.
  • HTTP errors are no longer reported as successful.
  • The domain and secret can be cleared to turn revalidation off, and invalid-domain errors are no longer shown twice.
  • The log limit is always respected, and the activity log is no longer autoloaded.
  • LICENSE.txt now contains the GPLv2 text.

Changed

  • Requests are sent after the editor’s response is finished, de-duplicated per request, with a 10 second timeout (was 45). Failures are retried in the background through WP-Cron.
  • The retry queue holds up to 5,000 paths (was 500), and the activity log is written once per run instead of once per path.
  • The test tool now sends POST, like real requests, and accepts any 2xx response.
  • Users without published posts no longer trigger author page revalidation.
  • content_revalidation_tracker_trigger_revalidation() returns true when the request is queued; the result is recorded in the activity log.
  • The “Sending revalidation request” admin notice was removed; see the Activity tab instead.

Deprecated

  • content_revalidation_tracker_on_post_trash() is no longer hooked.

2.0.1

  • Updated: “Tested up to” WordPress 7.0.
  • Fixed: Filter hook names now use the full plugin prefix, following WordPress coding standards.

2.0.0

  • Added: Custom post type and taxonomy prefix mapping.
  • Added: Manual test revalidation tool.
  • Added: Log limit setting.
  • Improved: Error handling and debugging.
  • Improved: Security validation and code optimization.

1.0.0

  • Initial release with automatic revalidation for posts, pages and users, secret key validation, dashboard logging and admin notices.