The wflogs folder is a Wordfence Security directory that stores important firewall and security logs. It is located inside the wp-content/ directory:
/home/user/public_html/wp-content/wflogs/
config.php)attack-data.php, ips.php)banned-ips.php)rules.php)If wflogs is too large, it may slow down your database and WordPress performance.
du -sh /home/user/public_html/wp-content/wflogs/
If the folder is over 500MB or several GBs, it's safe to clear old logs.
If wflogs is too large or causing issues, you can delete unnecessary logs.
cp -r /home/user/public_html/wp-content/wflogs /home/user/public_html/wp-content/wflogs_backup
Run:
rm -rf /home/user/public_html/wp-content/wflogs/*.php
rm -rf /home/user/public_html/wp-content/wflogs/*.json
sudo systemctl restart apache2
or
sudo systemctl restart nginx
If Wordfence is not loading correctly, reset wflogs:
rm -rf /home/user/public_html/wp-content/wflogs
mkdir /home/user/public_html/wp-content/wflogs
chmod -R 755 /home/user/public_html/wp-content/wflogs
chown -R www-data:www-data /home/user/public_html/wp-content/wflogs # For Apache
chown -R nginx:nginx /home/user/public_html/wp-content/wflogs # For Nginx
Wordfence will automatically regenerate wflogs when reactivated.
| Issue | Fix |
|---|---|
| wflogs too large | Delete old logs (rm -rf wflogs/*.php) |
| Wordfence firewall not working | Reset wflogs folder |
| Permissions issue | Set chmod -R 755 and chown -R www-data:www-data |
| Prevent excessive growth | Enable auto-cleanup in Wordfence settings |
Now your Wordfence logs are optimized, and your WordPress site runs faster!