The short answer

If your website has been hacked, don't delete anything yet. First make a full copy of the files and database, then take the site offline, change every password from a clean computer, and remove accounts you don't recognize. Only then find out how the attacker got in. Cleaning before you know the cause is the main reason hacked sites get reinfected.

Key takeaways

  • Copy everything before you change anything. The infected copy is your evidence.
  • Take the site offline at the hosting level so visitors stop being redirected.
  • Change every password from a computer you trust, and turn on two-step sign-in.
  • Don't restore an old backup until you know it's older than the attack.
  • Find how the attacker got in before you reopen the site.

A hacked website feels urgent, and the instinct is to start deleting. The order you do things in matters more than the speed. These eight steps keep visitors safe, protect the evidence, and give whoever fixes the site what they need.

1. Don't delete anything yet

The infected site is evidence. It shows which files the attacker changed, when, and usually how they got in. Deleting files or reinstalling over the top destroys that record, and the attacker's hidden way back in often survives anyway.

2. Make a full copy of the files and the database

Download everything: every file in the hosting account and an export of every database. Store the copy away from your everyday computer, on an external drive if you can, and label it as infected. Write down the date and time you took it.

Don't open the copied files in a browser or run them. Treat them as hostile.

3. Take the site offline

While the site is live, visitors may be sent to scam pages and the attacker's tools stay reachable. Ask your hosting company to stop serving the website while keeping email running. If they can't do that quickly, put a password on the whole site from the hosting control panel.

4. Change every password from a clean computer

Assume every password connected to the site is known to the attacker. From a computer you trust, change:

  • the hosting account
  • file transfer (FTP or SFTP) users
  • the database
  • every website administrator
  • email mailboxes on the same hosting account
  • the domain registrar

Turn on two-step sign-in wherever it's offered. Use a different long password for each account.

5. Remove accounts you don't recognize

Look at the list of website administrators, file transfer users and database users. Attackers often create their own accounts so they can simply log back in after a cleanup. Remove anything nobody on your team can explain, including accounts left over from past developers.

6. Write down what you saw and when

Keep a simple timeline: when you first noticed a problem, what it looked like, any warnings from your hosting company or from Google, and every change you make from here on. Take screenshots. This record saves hours later.

7. Check your backups before you trust them

A backup is only clean if it was made before the attack began. Many attacks start long before anyone notices. Compare each backup's date against the earliest sign of trouble, and treat any backup you can't date as infected.

8. Find the way in before you reopen

Reopening a cleaned site without closing the way in invites the same attack again. The usual causes are outdated software, a vulnerable plugin or custom page, a stolen password, or another site on the same hosting account. If you can't find the cause, a clean rebuild is safer than another cleanup.

Who you need to tell

Tell the people who run the site and anyone who depends on it day to day. If the site stored personal information, such as names, contact details or account logins, ask a lawyer whether you have a duty to notify anyone. That's a legal question, not a technical one.

Frequently asked questions

Should I delete the infected files right away?

No. Make a complete copy of the files and the database first and store it somewhere separate. The infected copy shows what the attacker changed and how they got in. If you delete it, you lose the only record of what happened.

Can I just restore yesterday's backup?

Only if you know the backup is older than the attack. Many attacks sit quietly for weeks or months before anything visible happens, so a recent backup often contains the same hidden files. Compare the backup's date against the earliest sign of the attack before you trust it.

Will my email stop working if I take the website offline?

It doesn't have to. A hosting company can usually stop serving the website while leaving email running. Ask for exactly that: suspend the website, keep email.

How do I know whether visitor or customer information was taken?

Often you can't tell from the website alone. It depends on what the site stored and whether the hosting company kept access logs. Write down what data the site held and ask a lawyer whether you have a duty to notify anyone.

Want a second pair of eyes on your site?

Within one business day

Your messageOur reply

Tell us what’s going on. We reply within one business day.

  • Reply within one business day

    Tell us what’s going on and you’ll hear back by the next business day.

  • Fixed or range-based pricing

    The scope is written down before work starts. No hidden fees.

  • You own every account

    Domain, hosting, data and code stay yours. No lock-in.