Recover a hacked website

Contain the damage, preserve evidence, restore or rebuild cleanly, close the vulnerability and request search engine reviews.

TutorialAdvanced120 min to completeLast updated
On this page
  1. What you’ll need
  2. Step 1: Work from a clean device
  3. Step 2: Change every password
  4. Step 3: Remove unknown access
  5. Step 4: Snapshot the current state
  6. Step 5: Choose restore or rebuild
  7. Step 6: Hunt for leftovers
  8. Step 7: Close the hole
  9. Step 8: Verify externally
  10. Step 9: Request reviews
  11. Check it worked
  12. If something goes wrong
Level
Advanced
Time
About 120 min
Steps
9
You’ll finish with
A working result, checked

9 steps

What you’ll need

  • Access to every login for the site and hosting
  • A clean device to work from
  • Any backups you have

Recovery succeeds when you remove the attacker’s access as well as the symptoms. Work through every step, even if the site looks fixed halfway through. My website has been hacked: what to do

Step 1: Work from a clean device

Use a computer you’re confident isn’t infected. Change your personal email password first.

Step 2: Change every password

Client area, registrar, DirectAdmin, mailboxes, FTP accounts, database users and every website admin. Hosting account security checklist

Step 3: Remove unknown access

Delete unfamiliar FTP accounts, email forwarders, cron jobs and website administrators.

Step 4: Snapshot the current state

Take a full backup and label it INFECTED — it holds your latest content. How to create and download a full account backup

Step 5: Choose restore or rebuild

Restore a backup from before the compromise if you have one. Restoring website files and a database manually Otherwise rebuild from fresh copies. WordPress: How to clean a hacked WordPress site

Step 6: Hunt for leftovers

Check uploads folders for PHP files, recently modified files and obfuscated code. How to find malicious files on your website

Step 7: Close the hole

Update everything, remove abandoned plugins, fix permissions and add hardening. Secure a new website and hosting account

Step 8: Verify externally

Browse from a Google result on mobile data, and scan with an external malware scanner. Website redirecting to spam or scam sites

Step 9: Request reviews

In Google Search Console, request a review of security issues. Check email blocklists if spam was sent. Email blacklists (blocklists): how to check and what to do

Check it worked

External scans are clean, no unknown users, forwarders or cron jobs remain, the site behaves normally from search results, and all software is current.

If something goes wrong

What happensWhat to do
Reinfected within daysA backdoor remains or the vulnerable plugin is still installed. Rebuild from fresh copies rather than cleaning.
Account suspendedFollow the notice’s instructions. Why is my hosting account suspended?

Where this fits: DirectAdmin hosting explains the control panel every Traxio account uses, with a tour and tutorials.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going