What is the Traffic Log Exclusions option and how does it work?
he Traffic Log Exclusions option is the exclusions system you can use to automatically skip the logging of web requests you know to be legitimate.
This reduces the size of your log and the speed at which it fills up, and also prevents your logs from filling up with "noise" (information you just don't need to have logged).
We recommend that you take a moment to consider which traffic you should exclude as there's no point in logging traffic that you don't need
How does the Traffic Log Exclusions work?
When a web request reaches your site, Shield examines it against each exclusion category you have selected.
If the request matches ANY single one (or more) of the exclusions, it will not be logged.
Here's an example:
Imagine you selected to only exclude 'AJAX' requests from the logs, but you haven't selected to exclude 'Logged-In Users'. What happens if you're logged-in and you're in the WP admin area and your page sends off an AJAX-request? You might think that since you're not excluding Logged-In Users that this should be logged. However, it wont appear in your logs because you're excluding AJAX requests.
Remember: If a request matches any single exclusion category it will not be logged.
The possible traffic exclusions are:
- Simple requests – any requests that do not contain any data parameters either in the GET query, or in the POST data.
- REST API
- Logged-In – any requests made by a user that is considered to be “logged-in” to the WordPress site.
- WP Cron
- Search Engine Spiders/Bots – supports Google, Bing, Yahoo!, Duck Duck Go, Yandex, Apple, Baidu
- Uptime Monitoring services – supports StatusCake, Pingdom, Uptime Robot
If you want to manually customize exclusions to skip the logging of web requests you know to be legitimate, you can use Custom Exclusions system.
This reduces the size of your log and also prevents your logs from filling up with information you might don't need to have logged.
How to manually customize exclusions
To demonstrate how to do this, we'll use an example...
Let's say we want to skip the logging of a web request called test-10.
We go to the Traffic Watch module => Traffic Logging Options and enter test-10 into the Custom Exclusions field:
From now on, if the test-10 text is present in either the User Agent or request Path (i.e. https://example.com/test-10), it will be excluded.
Remember: If a request matches any single exclusion text it will not be logged and your Traffic Watch Viewer will not display these logs.
Also, please note that custom exclusions do not apply to the current logs. They apply to the future web requests only.