Plesk WordPress Site Hacked? Scan, Clean and Verify
WP Toolkit can tell you whether WordPress core was tampered with and reinstall it in one click. A real cleanup needs a few steps that it does not cover.
When a WordPress site hosted on Plesk has been hacked, Plesk's WP Toolkit gives you a fast first check: it can compare the site's core files with the official checksums and reinstall them without touching your content. That is genuinely useful, and it is also where many cleanups stop too early, because the backdoor is rarely in WordPress core.
Start with the integrity check
In Plesk, open the domain, go to the WordPress tab, open WP Toolkit for the site, and choose Check WordPress Integrity, then Verify Checksums. A mismatch means core files differ from the official release for your version. Plesk's own guidance is to reinstall core when that happens.
Look where checksums cannot
The checksum check covers WordPress core only. Attackers prefer the places it does not reach. On Plesk a site normally lives in /var/www/vhosts/example.com/httpdocs, so run these checks there.
cd /var/www/vhosts/example.com/httpdocs
head -40 wp-config.php
find wp-content/uploads -type f -name '*.php'
find . -type f -name '*.php' -mtime -14 -printf '%T@ %p\n' | sort -n | tail -30
grep -rlE 'eval\s*\(\s*(base64_decode|gzinflate|str_rot13)' --include='*.php' .
Read the top of wp-config.php for anything that is not a define or a comment, since injected code there runs on every request. PHP files in uploads deserve suspicion, because that folder should hold media. Recently changed PHP files often cluster around the time of the attack, and the last command finds the most common decode-and-run pattern. For plugin files, compare them with clean copies of the same version, and for the core-style check from the command line see Check WordPress for Hacked Files with WP-CLI Checksums.
Find how they got in
Cleaning without finding the entry point is how sites get reinfected within days. Plesk keeps each domain's HTTPS access log at /var/www/vhosts/system/example.com/logs/access_ssl_log. Look at requests around the time of the first changed file, especially POSTs to plugin paths and requests for the suspicious files you found.
L=/var/www/vhosts/system/example.com/logs/access_ssl_log
grep '"POST ' "$L" | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
grep 'wp-content/uploads/.*\.php' "$L" | tail -20
Requests that reach a PHP file in uploads show the backdoor being used, and the addresses and timestamps tell you when it started. A POST pattern against one plugin's path usually names the vulnerable plugin.
Clean up in the right order
-
1
Back up the current state
Keep a copy of the files and database as they are, outside the web root. You may need the malicious files to understand the attack.
-
2
Reinstall WordPress core from WP Toolkit
Use Reinstall WordPress Core after a checksum mismatch. It replaces core files only, so it will not fix anything in plugins, themes or uploads.
-
3
Remove backdoors and replace altered plugins
Delete PHP files that should not exist, and reinstall any modified plugin or theme from a clean copy of the same version.
-
4
Update and change every credential
Update WordPress, plugins and themes, then change the WordPress administrator, FTP and Plesk passwords, and the database password in
wp-config.php. An attacker who read that file has the old one.
Verify the cleanup held
- Verify Checksums in WP Toolkit passes.
- The
findinuploadsreturns nothing, and the decode pattern search finds no matches. - The access log shows no further requests succeeding against the files you removed. Attempts returning 404 are fine and expected for a while.
- Repeat the recent-changes
finda few days later. New unexplained PHP changes mean something was missed.
Keeping a Plesk server ahead of the next one
One site cleaned by hand is manageable. A Plesk server with many subscriptions needs the same checks running all the time. BashSecure for Plesk follows Plesk subscriptions, domains and application roots. It scans file contents, watches the filesystem for new malicious files, and compares WordPress core with the official release while reporting modified files separately from malware. It identifies installed plugins with known published vulnerabilities, and Live Defense can log or stop harmful PHP behaviour while a request runs. Confirmed threats go into reversible quarantine instead of being deleted.