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


View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 3.0


View Parameters »

When viewing SearchWP statistics you’re shown data at various time intervals. Using this hook you can control the number of days used by SearchWP to calculate this data.

The primary use case for this hook is applicable when retrieving statistics is consuming available resources on the server, you can essentially ‘short circuit’ the problematic timeframe by filtering it to zero:

// Disable SearchWP Popular Year searches stat.
add_filter( 'searchwp_statistics_popular_days_365', '__return_zero' );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$days Integer

The number of days to consider for this statistics segment

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