Filter – securityninja_visitorlog_filter_url

With this filter you can control which URLs are filtered out from the visitor log.

If you want to remove repeated automatic requests to easier see what is going on it is very easy to filter those URLs out.

Here is an example where we filter out several types of requests that we don’t care about in the visitor log.

Note – this filter only looks at the URL.


 * WP Security Ninja filter -
 * Filters out additional matching URLs from the visitor log
 * Ref:
add_filter('securityninja_visitorlog_filter_url', 'filter_securityninja_vl_filter_url');

function filter_securityninja_vl_filter_url($filterlist) {
    $filterlist[] = '/?kinsta-monitor'; // Filter out requests from Kinsta
    $filterlist[] = '&mainwpsignature='; // Filter out requests from MainWP Dashboard
    $filterlist[] = '/wordfence_lh='; // Filter out Wordfence requests
    $filterlist[] = '/wp-login.php'; // Filter out login requests
    $filterlist[] = '/wp-json/'; // Filter out WordPress REST API requests
    $filterlist[] = '/apple-touch-icon.png';
    return $filterlist;


How to include on your website

Not sure how to add this code to your website? Check out this helpful article – How to include custom code on your website.

Was this helpful?