---
title: "Customizing the whitelist: a guide"
canonical: https://wpsecurityninja.com/docs/filters-hooks/securityninja_whitelist/
---
Use `securityninja_whitelist` to skip parts of the site during malware scans. Typical case: known false positives you are sure are safe.

Use wildcards such as `?` and `*` when matching files and folders.

```php
add_filter( 'securityninja_whitelist', 'filter_securityninja_whitelist' );

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

`*` matches any path segment before or after it, so you can whitelist a whole folder:

```php
$whitelist[] = '*/my-specific-folder-name/*';
```

> Introduced in **5.141**. Use a current plugin version.

## Examples

Whitelist the Classic Editor plugin folder:

```php
$whitelist[] = '*/wp-content/plugins/classic-editor/*';
```

Or a shorter pattern (matches any folder named `classic-editor`):

```php
$whitelist[] = '*/classic-editor/*';
```

Avoid generic folder names that would ignore more than you intend.

Whitelist one file only:

```php
$whitelist[] = '*/wp-content/plugins/classic-editor/classic-editor.php';
```

Whitelist a plugin upload folder (WP All Import example):

```php
$whitelist[] = '*/wp-content/uploads/wpallimport/*';
```

## Where to add the code

[How to include custom code on your website](https://wpsecurityninja.com/docs/installation-and-usage/custom-code-website/).

Related UI exclusions: [Exclude paths from the Malware Scanner](https://wpsecurityninja.com/docs/malware-scanner/how-to-exclude-paths-from-the-malware-scanner/) and [`securityninja_malware_exclude_paths`](https://wpsecurityninja.com/docs/filters-hooks/securityninja_malware_exclude_paths/).
