Filter – securityninja_whitelist

This filter allows you to customize the whitelist that Security Ninja uses while scanning for malware.

Use this filter to ignore sections of your WordPress installation from the malware scanner. This is useful if you have false positives, where there are files that look malicious but you know for sure they are not.

This function needs you to use wildcards such as ? and * for matching files and folders.

Here is a usage example – you can use in your child theme or a custom plugin.

add_filter( 'securityninja_whitelist', 'filter_securityninja_whitelist' );

function filter_securityninja_whitelist( $whitelist ) {
  $whitelist[] = '*/ignorefolder/*';
  $whitelist[] = '*/wp-content/uploads/ignore-this/*';
  return $whitelist;

Note: This filter was introduced in v. 5.141

Was this helpful?