The Definitive Recovery Guide
How to Recover Your Website After a Security Breach
A calm, ordered incident response — contain it, remove it, verify it’s actually gone, and get your reputation with Google and your visitors back
📋 What’s in this guide
- First: Confirm You’re Actually Hacked
- Step 1: Contain the Damage
- Step 2: Identify the Scope and Entry Point
- Step 3: Remove the Malware and Any Backdoors
- Step 4: Restore From a Clean Backup (If You Have One)
- Step 5: Rotate Every Credential
- Step 6: Patch the Actual Entry Point
- Step 7: Clear Google’s Security Warnings
- If Customer Data Was Involved
- Preventing the Next One
- Recovery Checklist
- Frequently Asked Questions
A hacked website triggers panic, and panic produces bad decisions — deleting things that were evidence, restoring a backup that’s also infected, or spending hours on the wrong fix while the actual backdoor stays open. Recovery goes faster and holds better when it follows a fixed order: contain, diagnose, remove, restore, rotate, patch, verify. This guide walks through each step in that order.
Go straight to Step 1 (Section 2) and take the site offline or into maintenance mode before reading further. Every additional minute a compromised site stays publicly accessible is more damage, more visitors potentially affected, and more work for Google to eventually re-crawl and clear once you’ve fixed it.
1. First: Confirm You’re Actually Hacked
Not every broken or strange-looking site is a security breach — some of these signs overlap with plugin conflicts, a bad update, or a caching issue. But taken together, or any one of them combined with an external warning, they’re a strong signal:
- Google Search Console shows a Security Issues warning, or Chrome/Safari shows a “Deceptive site ahead” or “This site may be hacked” warning to visitors
- Your host has suspended or flagged your account for abuse, malware, or spam origination
- Unfamiliar admin users, files, or scheduled tasks you didn’t create
- The site redirects visitors to an unrelated site, or shows different content to Google than to a browser (cloaking)
- A sudden spike in outbound email or server resource usage you can’t otherwise explain
- Unfamiliar pages appearing in Google’s index for your domain, often spam/pharma/gambling content you never published
2. Step 1: Contain the Damage
Take the site offline or into maintenance mode
This stops active harm to visitors and search engines while you work, and stops an attacker from doing further damage while you’re mid-investigation. Most hosts and CMS platforms support a maintenance mode that shows a holding page without deleting anything.
Change your hosting account password immediately
Do this before anything else, from a device you trust is clean. If the attacker still has access to your hosting control panel, everything else you do can be undone or re-infected while you’re working.
Preserve evidence before you start cleaning
Copy the current (infected) state of the site and its logs somewhere separate before deleting or overwriting anything. You’ll want this to identify the entry point in Section 3 — once you’ve cleaned the live site, that evidence is gone.
Notify your host if the compromise may affect other accounts
On shared hosting specifically, a compromised site can sometimes be used to attack other accounts on the same server. Your host needs to know regardless, since they may have their own logs or context that help identify the entry point faster than you can alone.
3. Step 2: Identify the Scope and Entry Point
Before cleaning anything, understand what actually happened — cleaning without knowing the entry point almost always means getting reinfected within days, since the door the attacker used is still open.
- Check server access and error logs around the time you first noticed symptoms, looking for unusual request patterns, unfamiliar IP addresses making repeated requests, or requests to files that shouldn’t exist
- Check for recently modified files — most file managers and SSH access let you sort by modification date; files changed outside your own normal update/deployment activity are a strong lead
- Review installed plugins/themes/extensions for known vulnerabilities — an outdated, vulnerable plugin is the single most common entry point on CMS-based sites
- Check for unfamiliar admin/user accounts created around the time of the breach
- Consider common entry points: an outdated CMS core, plugin, or theme; a weak or reused admin password; a vulnerable third-party script; or compromised credentials from an unrelated breach elsewhere reused on your site
A reputable malware scanner (many hosts include one, and dedicated security plugins/services exist for most CMS platforms) is genuinely useful for locating known malware signatures quickly. But scanners can miss custom or obfuscated backdoors, and they generally don’t tell you how the attacker got in — which is what Section 7 depends on to actually prevent a repeat.
4. Step 3: Remove Malware & Backdoors
- Remove any files, code injections, or database entries identified as malicious
- Specifically search for backdoors — small, often disguised scripts (frequently in uploads folders, theme files, or disguised as legitimate-looking core files) that let an attacker regain access even after the original vulnerability is patched
- Check for injected code in legitimate files, not just standalone malicious files — a common technique appends malicious code to the end of an otherwise legitimate, unmodified-looking file
- Remove any unfamiliar admin/user accounts found in Section 3
- Check scheduled tasks/cron jobs for anything unfamiliar that could re-trigger an infection
- Re-scan after cleaning, not just before, to confirm nothing was missed
The most common reason a “cleaned” site gets reinfected almost immediately isn’t a new attack — it’s a backdoor from the original compromise that survived the cleanup. If you’re not confident the cleanup was thorough, this is the point where paying for a professional malware removal service is often worth it over risking a second, avoidable incident.
5. Step 4: Restore From Backup (If You Have One)
If you have a backup from before the compromise, restoring it can be faster and more reliable than manually hunting down every piece of injected code — but only if you’re confident the backup itself predates the breach. See our backup and restore guide for how restoration actually works on most hosting platforms.
- Confirm the backup’s date is genuinely before signs of compromise appeared — restoring an already-infected backup accomplishes nothing
- Restore to a staging environment first if possible, and verify it’s clean before pushing it live
- Still complete Section 7 (patch the entry point) even after restoring — a clean restore doesn’t fix whatever let the attacker in the first time, so without patching it, you’re vulnerable to the exact same attack again
Our backup and data loss research covers how many sites actually have a usable, recent backup when they need one — a sobering number worth reading if this incident is what made you realize you don’t.
6. Step 5: Rotate Every Credential
Assume anything the attacker could have read was read, and change all of it — this step is easy to under-scope by only changing the one password you assume was involved.
- Hosting account / control panel password
- CMS admin passwords, for every admin-level account
- Database password (and update your application’s config file to match)
- FTP/SFTP credentials
- API keys and access tokens for any connected third-party service
- SSH keys, if used — generate new key pairs rather than assuming old ones are still safe
- Any password reused across other accounts or services, since credential reuse is itself a common entry vector
7. Step 6: Patch the Actual Entry Point
This is the step that actually prevents a repeat, and it depends entirely on what you found in Section 3.
- If it was an outdated plugin/theme/CMS core — update everything, and remove anything unmaintained or no longer needed rather than just patching it
- If it was a weak or reused password — enforce strong, unique passwords and enable two-factor authentication for all admin accounts going forward
- If it was a vulnerable third-party script or integration — update or remove it; if it’s abandoned/unmaintained, replace it entirely
- If the entry point genuinely can’t be identified — add a web application firewall in front of the site as a general hardening layer; see our WAF guide for how this helps even without knowing the exact original vulnerability
8. Step 7: Clear Google’s Security Warnings
If Google flagged your site (a Security Issues report in Search Console, or a browser warning to visitors), fixing the site alone doesn’t automatically remove the warning — you need to explicitly request a review once you’re confident everything is genuinely clean.
Confirm the site is fully clean first
Submitting a review request before you’re actually done risks a rejected review and a longer wait for the next one — don’t submit speculatively.
Open the Security Issues report in Google Search Console
It lists the specific issues Google detected, which is also a useful cross-check against what you found yourself in Section 3.
Submit a review request describing what you fixed
Explain the issue, the specific steps taken to fix it, and the outcome. Google’s own guidance notes most reviews take several days to weeks to complete.
Don’t resubmit while a review is pending
Per Google’s own guidance, resubmitting before a decision can extend the turnaround time for the next request. Wait for the email notification confirming the outcome.
9. If Customer Data Was Involved
If the breach may have exposed customer or user personal data (not just website files), this becomes a legal and communications matter, not only a technical one.
If your business is subject to GDPR (generally: you handle EU residents’ personal data, regardless of where your business is based), Article 33 requires notifying the relevant supervisory authority without undue delay, and where feasible within 72 hours of becoming aware of a personal data breach. This clock starts when you become aware of it — another reason not to delay investigation once you suspect a breach. See our GDPR and web hosting guide for the broader compliance picture.
Depending on your jurisdiction and industry, there may be additional notification obligations beyond GDPR (state-level breach notification laws in the US, sector-specific rules for healthcare or financial data). This is a genuine point to involve legal counsel rather than guessing — the technical cleanup and the legal/notification obligations are separate tracks that both need attention.
10. Preventing the Next One
- Keep CMS core, plugins, and themes updated on an ongoing basis, not just after an incident
- Use strong, unique passwords and two-factor authentication for every admin account
- Set up uptime and integrity monitoring so a future compromise is caught in minutes, not weeks — see our monitoring guide
- Maintain automated, off-server backups with a retention window long enough to have a genuinely clean restore point available
- Add a web application firewall as a standing layer of protection, not just a post-incident response
- Remove unused plugins, themes, and accounts — anything installed but not maintained is attack surface with no offsetting benefit
11. Recovery Checklist
- Site taken offline or into maintenance mode
- Hosting account password changed immediately
- Evidence (logs, infected file state) preserved before cleanup
- Entry point identified, not just symptoms cleaned
- Malware and backdoors removed, then re-scanned to confirm
- Clean backup restored, if available and verified pre-breach
- Every credential rotated — hosting, CMS, database, FTP, API keys, SSH
- The actual entry point patched, not just the visible damage
- Google Security Issues review requested, if flagged, only once genuinely clean
- Legal/notification obligations assessed if any customer data was involved
- Monitoring and backups improved to catch and recover from a future incident faster
12. Frequently Asked Questions
How long does it take Google to remove a security warning after I fix the site?
Per Google’s own guidance, most reconsideration reviews take several days to a few weeks after you submit the request. The warning doesn’t disappear automatically just because you’ve cleaned the site — you need to actually submit the review request in Search Console once you’re confident it’s resolved.
Should I hire a professional malware removal service instead of doing this myself?
If you’re not confident you found every backdoor, or the site is business-critical and downtime is costly, a professional service is often worth it — missing one backdoor typically means a fast, frustrating reinfection. For a simple, well-understood compromise on a site you’re comfortable investigating yourself, the steps in this guide are a reasonable starting point.
Can I just restore an old backup and skip the investigation?
You can restore a clean backup to get the site back online faster, but skipping Section 3 entirely means you don’t know how the attacker got in — and without patching that specific entry point (Section 7), a restored-but-unpatched site is vulnerable to the exact same attack again, often quickly.
Will this happen again even after I fix everything?
No security measure makes a site permanently unhackable, but properly identifying and patching the actual entry point, rotating all credentials, and adding ongoing monitoring and updates meaningfully reduces the risk of both a repeat of the same attack and most opportunistic future ones.
My host suspended my account — how do I get it reinstated?
Contact your host’s support directly, explain the steps you’ve taken to clean and secure the site, and ask what they specifically need to see before reinstating access. Hosts generally want the same evidence of a genuine, complete cleanup that Google’s review process does — a rushed or partial fix is likely to result in a second suspension.
Contain First,
Panic Never.
A security breach feels like an emergency that demands doing everything at once, but the sites that recover cleanly are the ones that work through this in order — contain the damage, understand what actually happened, remove it completely, restore safely, rotate every credential, and patch the real cause. Skipping ahead to “just clean it and move on” is exactly how sites end up back here within the month.
Once you’re through recovery, the monitoring and backup habits in Section 10 are what turn “this happened once” into “this got caught and stopped fast” if it ever happens again.
Find the door.
Then close it.