Security 5 min read

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.

By BashPilot Team
BashSecure Malware & vulnerability protection Scan, find and remove malware across every hosted account. Explore BashSecure

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.

the usual hiding places
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.

POST requests and hits on a suspicious file
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. 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. 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. 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. 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 find in uploads returns 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 find a 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.

Share LinkedIn X
Questions

Frequently asked questions

How do I check if WordPress core files are infected in Plesk?

Open the domain in Plesk, go to the WordPress tab and open WP Toolkit, then choose Check WordPress Integrity and Verify Checksums. Plesk says this requires WP Toolkit 5.6 or later. A mismatch means core files differ from the official release, and Plesk recommends reinstalling WordPress core.

Does Reinstall WordPress Core delete my content?

No. Plesk describes it as reinstalling only the WordPress core files, leaving all other WordPress data untouched. Take the backup WP Toolkit offers before you run it, because it also will not remove malware from plugins, themes or the uploads folder.

Why is my WordPress site Quarantined in WP Toolkit?

WP Toolkit marks a site Quarantined when it cannot access the site's files properly. Plesk says malware is a common cause, but also documents cases where operations simply timed out. Check `wp-config.php` for injected code and scan the subscription before you conclude anything.

Is a clean Verify Checksums result proof the site is clean?

No. It covers WordPress core files only, and cannot check files with site-specific content such as `wp-config.php` and `index.php`. Plugins, themes, uploads and the database need separate checks, and most backdoors are found there.

Where are a domain's access logs on Plesk?

Plesk keeps them under `/var/www/vhosts/system/DOMAIN/logs/`. The HTTPS access log is `access_ssl_log`, and when nginx proxies to Apache the nginx side is `proxy_access_ssl_log`. Searching them for requests to the files you removed shows how and when the attacker used them.

Put your servers on autopilot.

Connect a server in about a minute. The first week is on us.