Overview: connection status, last revalidation, success rate, pending retries, setup checklist and recent activity.
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.
/blog/my-post/).POST https://your-frontend.com/api/revalidate?path=/blog/my-post/ with the secret in the X-Revalidate-Secret header.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.
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).