Reduce Wordfence CPU usage, disable Wordfence "Live Traffic View"

The Wordfence "Live Traffic Options" ("Traffic logging mode") feature can cause high CPU usage and load issues for WordPress websites.
Published on Monday, 23 September 2019

Whenever WordPress is using a lot of CPU and you have Wordfence Security plugin enabled, it is recommended to double check some settings. Unfortunately the Wordfence "Live Traffic Options" ("Traffic logging mode") feature can cause high CPU usage and load issues for WordPress websites. Therefore, I recommend you disable this feature to improve the performance of your WordPress website.

If you want to disable Wordfence Security Live Tracking through your WordPress Dashboard, then follow these steps:

  • Log on in WordPress
  • Click Wordfence →
    • All Options
      • Scroll down to Tool Options
        • Make sure Traffic Logging mode is set to "Security Only"
  • click "Save Changes" to save your changes

logging mode in Wordfence's Live Traffic Options

In older Wordfence versions you had to deselect the option "Enable Live Traffic View", or you could make the changes in your MySQL database (as explained blow).

WordPress .htaccess security best practices in Apache 2.4.6+

If you want to work directly in your MySQL database: execute the following SQL statement on your MySQL command prompt, or in PhpMyAdmin.

MariaDB [examplecom]> select * from wp_wfconfig where name = "liveTrafficEnabled";
+--------------------+------+----------+
| name               | val  | autoload |
+--------------------+------+----------+
| liveTrafficEnabled | 1    | yes      |
+--------------------+------+----------+
1 row in set (0.002 sec)

MariaDB [examplecom]> update wp_wfconfig set val = 0 where name = "liveTrafficEnabled";
Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [examplecom]> select * from wp_wfconfig where name = "liveTrafficEnabled";
+--------------------+------+----------+
| name               | val  | autoload |
+--------------------+------+----------+
| liveTrafficEnabled | 0    | yes      |
+--------------------+------+----------+
1 row in set (0.001 sec)

The first SELECT statement shows Wordfence's liveTrafficEnabled is set to 1 (enabled). The second statement (UPDATE) sets its value to 0 -making it disabled, and the third statement confirms this change.

Now you have Wordfence Live Visitor Tracking feature is disabled. This should be noticeable in your WordPress CPU usage almost immediately.

How to disable WordPress comments

The wfconfig name liveTrafficEnabled and its value control the traffic logging mode: 1 means All Traffic and 0 is Security Only.