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

searchwp\index\rebuild

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.

Parameters

There are no parameters for this hook.

Examples

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

<?php
// Send an email to the site adminstrator when the SearchWP Index is reset.
add_action( 'searchwp\index\rebuild', function() {
wp_mail(
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