Programmatically pause the SearchWP indexer during a content import
This file contains 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
<?php | |
// in order to prevent the SearchWP indexer from being triggered many times at once | |
// we are going to disable it while we run our content import like so: | |
add_filter( 'searchwp_indexer_enabled', '__return_false' ); | |
// process our content migration | |
my_begin_content_import(); | |
// with the migration complete we can re-enable the SearchWP indexer and | |
// it will pick up all of the content that was just imported | |
remove_filter( 'searchwp_indexer_enabled', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment