My website has been hacked: what to do

The signs a site is compromised and a clear recovery order: contain, preserve, restore or clean, close the hole, and check search engines.

Guide2 min readLast updated
On this page
  1. Does this match what you’re seeing?
  2. 1. Confirm it
  3. 2. Contain
  4. 3. Preserve
  5. 4. Restore or clean
  6. 5. Close the hole
  7. 6. Check and recover reputation
  8. If the account was suspended
  9. Common questions

Does this match what you’re seeing?

  • The site redirects visitors to spam, gambling or scam sites
  • Google or the browser warns the site is dangerous
  • Unfamiliar files, users or pages have appeared
  • Your host or visitors report spam being sent

Work through this in order. Rushing to delete the visible problem often leaves the way back in.

1. Confirm it

  • Visit the site logged out, in a private window, on mobile, and by clicking through from a Google result — some infections only show to certain visitors.
  • Look for a warning in Google Search Console’s Security issues report.

2. Contain

  • Change every password: client area, DirectAdmin, email, FTP, database users, website admins. Hosting account security checklist
  • Remove unknown FTP accounts, email forwarders, cron jobs and admin users.

3. Preserve

Take a backup of the current state before changing files. It holds your latest content, and helps you understand what happened.

4. Restore or clean

If you have a clean backup from before the compromise, restoring it is fastest and most reliable. Restoring website files and a database manually If you don’t have one, you can ask through the contact form whether Traxio’s courtesy backups can restore a date before the compromise, but that isn’t guaranteed. Does Traxio back up my website?

If not, rebuild: fresh copies of the application, plugins and themes from official sources; keep only your own content and uploads after checking them. WordPress: How to clean a hacked WordPress site. Finding injected files: How to find malicious files on your website.

5. Close the hole

The site will be reinfected unless you fix how they got in:

6. Check and recover reputation

If the account was suspended

Notices explain why and what’s needed before the account can be restored. Why is my hosting account suspended?

Prefer to follow along?

Common questions

My website has been hacked — what do I do?

Change every password first, then take a copy of the site as evidence before cleaning anything. Find and remove the malicious files, update everything, and only then bring the site back. Restoring a backup without closing the original hole just gets you reinfected.

The part people skip is removing the attacker’s access — a hidden admin user, an added SSH key or a backdoor file in an unexpected folder. If you clean the visible damage but leave that, the site is reinfected within days.

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

Keep going