Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7studio/6bc43c1b202e84376cafce36bf0016c5 to your computer and use it in GitHub Desktop.
Save 7studio/6bc43c1b202e84376cafce36bf0016c5 to your computer and use it in GitHub Desktop.
Force indexation of Search WP.
<?php
/**
* Force indexation of Search WP
* May cause trouble on production site
*
* @author Maxime CULEA
*/
/* @see https://searchwp.com/docs/hooks/searchwp_lazy_settings/ */
add_filter( 'searchwp_lazy_settings', '__return_false' );
/* @see https://searchwp.com/docs/hooks/searchwp_indexer_throttle/ */
add_filter( 'searchwp_indexer_throttle', function() { return 0; } );
/* @see https://searchwp.com/docs/hooks/searchwp_load_maximum/ */
add_filter( 'searchwp_load_maximum', function() { return 50; } );
/* @see https://searchwp.com/docs/hooks/searchwp_index_chunk_size// */
add_filter( 'searchwp_index_chunk_size', function() { return 100; } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment