Year-end offer: 30% off your first 6 months. Order by 31 December.

WP Rocket security update (CVE-2026-125812): update and check your WordPress server

WP Rocket fixed a critical security hole tracked as CVE-2026-125812. Because caching plugins handle incoming page requests and cache files on disk, a flaw there puts the whole WordPress server at risk. Here is how to check your version, update cleanly, clear old cache files, and look for signs of trouble.

Short version: check your WP Rocket version on every WordPress site today, update to the latest patched release, clear the WP Rocket cache folder, and check your logs if you were running an old version.

Why cache plugins need fast updates

Page cache plugins sit right in front of WordPress. They run early, write cached HTML files into wp-content/cache/, and react to query strings, headers, and logged-in cookies. When a bug allows remote code execution or unsafe file handling (like CVE-2026-125812), an attacker does not need an admin password to reach your server.

Even if your WordPress login page is hidden or protected with two-factor login, public page visits still hit the caching layer. That is why server owners should treat caching plugin patches with the same urgency as WordPress core updates.

1. Check which version is installed on your server

If you manage WordPress on your own Ubuntu or Debian server, WP-CLI gives you an exact answer in seconds without clicking through every site admin panel:

cd /var/www/your-site
sudo -u www-data wp plugin list --name=wp-rocket

Running several WordPress sites on one server? Loop through your site folders from the terminal (adjust the path if your sites live under /home/ or /srv/):

for dir in /var/www/*; do
  [ -f "$dir/wp-config.php" ] || continue
  echo "=== $dir ==="
  wp --path="$dir" plugin list --name=wp-rocket --allow-root
done

2. Back up before updating

Save a copy of the database and files first so you can roll back if a cache setting changes after the update:

wp db export ../backup-before-wp-rocket.sql
tar czf ../site-before-wp-rocket.tar.gz wp-content/plugins/wp-rocket

Keep backups outside the web folder where visitors cannot download them, and follow our guide on how to back up a PHP site and test the restore.

3. Update WP Rocket and clear the cache folder

Run the update through WP-CLI (or upload the latest patched zip if your license handles manual updates):

sudo -u www-data wp plugin update wp-rocket
sudo -u www-data wp cache flush

After updating, delete old cached HTML and minified assets on disk so nothing stale remains:

rm -rf wp-content/cache/wp-rocket/* wp-content/cache/min/*

Then visit two or three key pages (your home page, checkout, and contact form) in a private browser window to confirm pages load cleanly and forms still submit.

4. Check logs and disk for unexpected files

If a site sat unpatched for several days after CVE-2026-125812 became public, check whether anyone probed your site or dropped unexpected PHP files:

# Look for recently modified PHP files in wp-content/
find wp-content/ -type f -name '*.php' -mtime -14 -ls

# Scan the site folder for malware with ClamAV
clamscan -r --infected wp-content/

Also inspect your Nginx or Apache access logs for suspicious POST requests to cache or plugin endpoints. If you find unknown PHP files in wp-content/uploads/ or wp-content/cache/, stop and follow our first steps for a hacked PHP site and scan your PHP site with ClamAV.

5. Consider Nginx FastCGI caching to shrink PHP attack surface

One of the best ways to reduce WordPress plugin exposure long term is letting Nginx serve cached HTML pages directly, before PHP even starts. You keep PHP attack surface smaller and get faster response times at the same time. See our guide on making WordPress fast with Nginx FastCGI cache and our full WordPress server hardening checklist.

← Back to the security blog