How can we help?

Search for answers or browse our knowledge base.

Table of Contents

Excluding files and directories from the WordPress file changes scan

Before you exclude any files or directories…

It is important to understand which files and directories the Website File Changes Monitor plugin scans on your WordPress site by default. As a rule of thumb, the plugin scans everything apart from media and non executable files such as videos, images, text files and log files. The plugin also scans custom code and web applications that are in any of the WordPress directories.

Refer to file changes monitoring and WordPress for more information on file integrity scanning.

Excluding directories from file changes scans

Excluding the default WordPress directories

The WordPress file changes scan is divided in seven sub-scans:

  • WordPress core (the website root directory, and the wp-admin and wp-includes directories)
  • /wp-content/
  • /wp-content/themes/ (themes directory)
  • /wp-content/plugins/ (plugins directory)
  • /wp-content/uploads/
  • /wp-content/sites/* (only on multisite networks)

You can exclude any of these directories from file changes scans from the plugin’s settings, by unticking the directory name from the Directories to scan setting, highlighted  in the below screenshot.

excluding the default wordpress directories

Excluding other directories

If you want to exclude a specific directory specify the directory path and name in the Exclude All Files in These Directories setting. As shown in the below screenshot, by default the plugin does not scan the /wp-content/cache directory. The plugin does not scan this directory because it is used by caching plugins, so file changes in this directory are very normal.

Excluding directories from the WordPress file changes scan

It is very important to specify the absolute path of the directory you want to exclude. If you do not know it, use this PHP script to find the absolute path of the directory.

Excluding files from file changes scans

Excluding specific individual files

To exclude a specific individual file from the WordPress file changes scan just add it to the Exclude These Files setting. There is no need to specify the path of the directory, simply add the filename and extension.

Setting to exclude individual file from file changes scan

Excluding file types from file changes scans

The other option to exclude files is to exclude by file type. For example, if you do not want to scan any exe files add exe to the Exclude These File Types setting in the plugin. Notice in the screenshot below that the most common non-executable and media files are excluded by default from the WordPress file changes scan.

Setting to exclude file types from changes scan