Excluding Files and Folders from Malware Scanning

 

Security by CleanTalk includes a powerful Malware Scanner designed to detect suspicious and malicious code on your website. However, in some cases, it is both safe and recommended to exclude specific files or directories from scanning.

Exclusions let you fine-tune scanning by skipping locations that are known to be safe, irrelevant, or managed separately. This helps reduce false positives, speeds up scanning, and prevents unnecessary resource usage.

In this article, we explain how file and directory exclusions work in Security by CleanTalk, including how to use the spbct_directory_exclusions.txt file and provide practical examples of when and why exclusions should be applied.

You can find the exclusion option in our plugin settings:

  • WordPress Admin Page —> Settings —> Security by CleanTalk —> General Settings —> Directory and file exclusions for the malware scanner.

Option to exclude

Below are practical examples of exclusions. A key rule applies to all: excluding a directory will also skip all its subfolders and files. Use any directory separator (/ or \) in your paths. Separate each path with a new line. You can specify both directories and files.

 

To further optimize scanning, exclude non-critical directories and individual files that don't require security checks, such as development or log files.

Example exclusions:

  • wp-content/uploads/dev/script.php
  • wp-content/themes/test-theme
  • wp-content/logs

 

In some environments, a single hosting account may contain multiple websites located in subdirectories, for example:
site1.com/

├── site2.com/
└── old-site/
 
Directories containing other websites should be excluded. This prevents unnecessary resource usage. Each nested website should be scanned by its own instance of Security by CleanTalk.

Example exclusions:

  • site2.com
  • old-site

 

Backup folders often contain copies of your website’s files. Scanning these duplicates can trigger false alerts and consume unnecessary resources.

Example of exclusion:

  • wp-content/backups

Note: your backup folder path may vary. If it is different, specify the correct path to it.

 

Cache folders store temporary data generated by plugins, themes, or server-side caching systems. These files are dynamic and not part of the original codebase, so scanning them may lead to irrelevant results.

Example of exclusion:

  • wp-content/cache

Note: your cache folder path may vary. If it is different, specify the correct path to it.

 

Create a file spbct_directory_exclusions.txt with a list of folders you want to exclude from the security checks.

Example of such a file:

ignore me
woocommerce
wordfence
contact-form-7

Then upload it to any public place, copy-paste its URL to the field "Directory exclusions for the malware scanner" and save the plugin settings.

Example:

https://website.com/public/spbct_directory_exclusions.txt

The plugin will recognize the content of the file and inform you about it in the tooltip:

exclusions in Security CleanTalk by URL to file

 

You can follow the same process using a file named spbct_allowed_domains.txt containing the list of domain names you wish to exclude. Simply create the file, upload it to a publicly accessible location, and paste its URL into the "Allowed domains" field.

Example:

goodwebsite.com
testwebsite.net
notgoogle.org

exclusions in Security CleanTalk allowed domains

Couldn't find what you were looking for? Contact our technical support team for assistance.

Was this information helpful?

It would also be interesting

Copied to clipboard