← All posts

How to Build an Auto-Indexing Pipeline for a Publishing Site

How to Build an Auto-Indexing Pipeline for a Publishing Site

A site that publishes three times a week does not need an indexing routine. A site that publishes thirty times a week does, because the manual step gets skipped on exactly the day it matters. The common answer for bulk indexing WordPress content is a plugin that connects to Search Console and submits on your behalf, which holds up until the connection expires or the quota arrives. The alternative is a pipeline you own end to end: a publish event, a queue, a batched submission, and a verification leg that tells you what Google did rather than what your server sent.

One piece of framing decides whether any of it is worth building. A submission asks Google to look at a URL. Nothing about it obliges Google to keep what it finds, because selection into the index is Google’s decision. A pipeline cannot change that. It can make sure every new URL is offered promptly, once, and that somebody checks afterwards.

Fire on the publish transition, not on save

WordPress offers several hooks that look correct and are not. save_post fires on autosaves, on revisions, and on every metadata write, so a pipeline hung off it will submit the same post a dozen times before the author has finished the second paragraph. publish_post covers the classic post type only, which is fine until someone adds a custom type for guides or case studies.

The hook worth building on is transition_post_status, because it hands you the old status alongside the new one. You act on one thing: any status becoming publish. Guard it anyway, skipping revisions and autosaves. Note that a scheduled post makes that transition on cron, which is the two-in-the-morning case that made you want a pipeline.

The handler itself should do almost nothing: write a row to a table of your own with the post ID, the permalink, the transition, and a timestamp. No HTTP call inside the publish request. The queue is the part that survives a plugin update.

Bulk indexing WordPress posts means batching the day, not the minute

Draining the queue on a schedule beats submitting each post the second it appears. A batch of forty URLs is one request to retry rather than forty to reconcile, and it gives you a deduplication window: an editor who publishes, unpublishes, and republishes within ten minutes produces one entry, not three. Every fifteen minutes suits a busy site, hourly suits most others.

Do not leave the drain to WP-Cron. It fires on page requests, so on a quiet site it runs whenever a visitor happens to arrive, which is the opposite of what you want at 3am. Set DISABLE_WP_CRON and call wp-cron.php from a real system cron instead.

None of this replaces the sitemap. Keep regenerating it on publish and let lastmod reflect a genuine change, since Google leans on a sitemap it has learned to trust and ignores one it has not. The queue handles the new and the urgent; the sitemap stands as the open invitation.

Decide what never enters the queue

A publishing site generates far more URLs than it wants indexed. Attachment pages, paginated archives, date archives, and most tag archives belong nowhere near a submission list. Neither does anything marked noindex, because Google drops a noindexed URL from results whatever else you do with it.

The reliable filter is the rendered page, not the plugin’s settings screen. Fetch the permalink your queue recorded, read the robots meta tag and the canonical, and drop anything that asks not to be indexed or points elsewhere. That one check catches the per-post override somebody set six months ago and forgot. If a page keeps coming back ineligible, the reasons Google declines a page that looks fine are the place to start.

Rule out one channel early. Google’s Indexing API accepts job posting and livestream pages, a restriction stated in Google’s own quickstart, and wiring it to ordinary articles returns a clean response that means nothing.

The leg most pipelines never build

Everything above produces receipts. A receipt says a request left your server, which is not what you wanted to know, and that gap is why submitted and indexed have to be recorded as separate events.

This is the part AIndexify handles for the pipelines that call it. URLs arrive pasted or as a CSV, up to 10,000 per submission, with no Search Console connection and no ownership proof required, which is what makes it callable from a cron job rather than a browser tab. Each URL is then checked against live Google results on a fixed schedule, at 24h, 48h, 96h and 7d on Fast, or at 1h, 4h, 12h, 24h, 72h and 7d on Instant, and the status names the date a page was first found. A URL carrying noindex, a 404, or a robots block is caught before any check is billed and the credit is refunded.

Whatever comes back, write it into the queue table beside the submission row. A pipeline that stores only what it sent can tell you nothing a month later.

Three ways this breaks

Slug edits after publish. An editor renames a post an hour after it goes live and the queued URL now redirects. Re-resolve the permalink at drain time rather than trusting the one recorded at publish.

Typo edits treated as new content. If you fire on updates too, hash the post content and skip when only metadata moved. Resubmitting because somebody fixed an apostrophe teaches you nothing and costs a credit.

A drain that stops silently. Cron dies, the queue grows, and nobody notices for a fortnight because the dashboard shows only successes. Alert on queue depth and on time since the last successful drain.

If you have a pipeline running already and no record of what came of it, submit your URLs and let the checks report back. Seeing which pages Google actually kept is the only way to know whether the pipeline is working or merely running.

Sources