Note: You are viewing the documentation for Version 4View Version 3 Docs


Since: 4.0.0

Table of Contents

This action is fired any time the Index is reset, just prior to the rebuilding job is triggered.


There are no parameters for this hook.


All hooks should be added to your custom SearchWP Customizations Plugin.

Send an email when the index is reset

Send an email to the site administrator when the Index is reset

// Send an email to the site adminstrator when the SearchWP Index is reset.
add_action( 'searchwp\index\rebuild', function() {
get_option( 'admin_email' ),
'SearchWP Index Reset',
'The SearchWP Index has been reset.'
} );

How to use this code

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP