feat(indexnow): add datamachine_indexnow_skip_auto_submit filter for bulk ops#2386
Merged
Conversation
…bulk ops Lets bulk/background operations (e.g. large historical event imports) suppress the per-post IndexNow auto-ping, which otherwise fires one synchronous outbound HTTP POST per published post. Without this, a bulk import of thousands of posts would emit thousands of pings asking search engines to crawl everything at once and stall the import runtime. Defaults to false (unchanged behavior); callers set it true around the bulk loop and restore it after.
Contributor
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a generic
datamachine_indexnow_skip_auto_submitfilter to the IndexNow auto-ping, so bulk/background operations can suppress the per-post outbound ping.Why
IndexNowAbilities::on_post_saved()fires one synchronouswp_remote_postto IndexNow per published post. A bulk operation that publishes thousands of posts (e.g. a large historical event import) would emit thousands of synchronous outbound pings — stalling the import runtime and pointlessly asking search engines to crawl everything at once.What changed
on_post_saved()now checksapply_filters('datamachine_indexnow_skip_auto_submit', false, $post_id, $post)before submitting. Defaults to false (unchanged behavior).add_filter('datamachine_indexnow_skip_auto_submit', '__return_true')... loop ...remove_filter(...).The filter name is shared with extrachill-seo's IndexNow integration (separate PR) so a single filter suppresses both pingers during one bulk operation.
First consumer
Extra-Chill/extrachill-users concert-import (PR #82) wraps its historical-event import batch in this filter.
Conventional commit; no version/changelog hand-edits.