This Documentation is for SearchWP Version 3

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