What not to do.
Most of the damage in a WordPress compromise happens in the response, not the attack.
-
Don't delete files you think look suspicious. Without knowing what the attacker changed, you are as likely to break the site as clean it, and you destroy the evidence trail.
- Don't immediately restore an old backup and consider it done. If the vulnerability that let them in is still present, and it usually is, you have simply reset the clock. Restoring a backup is a step, not a solution.
- Don't reinstall plugins from scratch and assume that clears it. Compromises frequently sit in the uploads directory, in the database, or in files that look entirely legitimate.
- Don't ignore it because the site looks normal to you. A large share of WordPress compromises are deliberately invisible to logged-in administrators and only show malicious content to search engines or to visitors arriving from Google.
- Don't skip telling people. If customer data may have been accessed, you have obligations under U GDPR and the timescales are short.
How to tell how serious it is.
Not every compromise is equal, and the response should scale to the severity. Broadly, there are three levels.
1. Nuisance
Spam links injected into pages or posts, usually invisible to you and visible to Google. Irritating, damaging to rankings, and generally the cheapest to resolve.
2. Serious
Redirects sending your visitors elsewhere, injected scripts, fake admin accounts, or your server being used to send spam. At this point, your domain reputation and your email deliverability are both at risk, and Google may already have flagged you.
3. Critical
Any evidence of database access where customer data, orders or personal information is held. This is no longer a website problem. It is a data breach, and the priority shifts from fixing the site to establishing what was taken.
If you can't confidently place your situation in one of those three, treat it as the level above your guess.
How the clean-up actually works.
A proper remediation has five parts, and skipping any one of them is why sites get reinfected.
- Identify the entry point. Usually an outdated plugin or theme, sometimes stolen credentials, occasionally the hosting environment itself.
- Remove the malicious code, including anything left in the database and in the uploads directory, not just in the plugin that was exploited.
- Find and close the backdoors. Attackers almost always leave a second way in, and this is the step that separates a clean-up that holds from one that does not.
- Patch the vulnerability that allowed it, and update everything else while you're there.
- Harden and monitor, so the next attempt is caught rather than discovered.
Why it happened.
It's almost certainly not because WordPress is insecure.
Security researchers consistently find that the overwhelming majority of WordPress compromises come through plugins and themes rather than WordPress core, followed by weak and unpatched hosting.
Which is uncomfortable, because it means the cause is usually something that was known about and could have been prevented. We have written separately about where the real risk sits and about why so many businesses stop updating.
Stopping it from happening again.
Once the site is clean, the work that matters is unglamorous: updates applied on a schedule rather than when someone remembers, a staging environment so updates can be tested before they go live, backups that are stored off the server and actually tested, restricted admin access with two-factor authentication, and monitoring that tells you about a problem rather than leaving you to notice it.
None of that is difficult. It just needs to be somebody's job. When it's nobody's job, this article becomes relevant again in about eighteen months.
Common questions.
Can a WordPress site be hacked?
Yes, like any website on any platform. WordPress is targeted more than most simply because it powers such a large share of the web, which makes automated attacks against it worthwhile at scale. The platform itself is well maintained; the risk almost always sits in what has been added to it.
How do I find hacked files in WordPress?
Compare your installation against clean copies of WordPress core, your theme and your plugins, and look for files whose modification dates do not match a change you made. Malicious code is frequently obfuscated and placed in legitimate-looking files, so a visual scan is unreliable. This is the point at which a scanner or a developer is worth more than an afternoon of your time.
Will I lose my Google rankings?
Possibly, temporarily, and it's recoverable. Rankings suffer when Google detects injected content or flags the site as unsafe. Once the site is clean and you have submitted a review request through Search Console, positions usually return, though it can take weeks. The longer a compromise stays live, the longer the recovery.
Should I just rebuild the site instead?
Sometimes, yet. If the site was already outdated, running abandoned plugins, or built in a way no one can maintain, a clean-up buys you months rather than years. We'll tell you honestly which situation you're in, because a remediation on a site that needs replacing is money spent twice.
Talk to our team.
We build and maintain WordPress sites for businesses across the UK from our HQ in Manchester, UK, with security handled at the code level rather than patched on afterwards. No juniors, no outsourcing.
If your site has been compromised, or you would rather it never was, we should talk.