Free, independent guides since 2010

Security & privacy

My website is hacked: a recovery plan

Step-by-step recovery for a hacked website: recognising the signs, containing the damage, finding the cause, cleaning or restoring, closing the hole, requesting reviews from Google and preventing a repeat.

<guide section="Security & privacy" type="article" read="1 min"/>

It happens to careful people too. What matters is a calm, systematic response. If personal data may be affected, also follow what to do after a data breach.

Signs of a hack

  • Search results for your site show pages in other languages, pharmacy or gambling spam.
  • Visitors from Google are redirected to other sites (often only on mobile).
  • Browser or Search Console warnings about malware or deceptive content.
  • Unknown admin users, files or scheduled tasks.
  • Your hosting provider suspends the account or reports outgoing spam.

Step 1: contain

  1. Change passwords of hosting, CMS admins, database, SFTP and email – from a clean device.
  2. Enable two-factor authentication everywhere.
  3. Put the site in maintenance mode or take it offline if it harms visitors.
  4. Inform your hosting provider; they may have logs and tools.
  5. Make a copy of the hacked site for analysis.

Step 2: find the cause

  • Outdated plugin, theme or CMS (the most common cause).
  • Stolen or weak password.
  • A vulnerable upload form.
  • Compromised computer of someone with access.

Check server access logs around the time of the first changes, and the modification dates of files.

Step 3: clean or restore

OptionWhen
Restore a clean backupYou know when the hack started and have an older backup
Reinstall core and plugins, clean the databaseNo clean backup, or recent content must be kept
RebuildSmall or old site where cleaning costs more than rebuilding

After restoring, immediately update everything and remove what was exploited.

Step 4: tell Google and visitors

  • Check the Security Issues report in Search Console and request a review.
  • Remove spam URLs (let them return 404 or 410).
  • Inform customers if their data or accounts may be affected.

Step 5: prevent a repeat

Work through the security checklist, set up a firewall and file-change monitoring, and test your backups.

Frequently asked questions

Should I pay a cleanup service?

If you lack the time or skills, a reputable service or your web developer can save days. Ask what they do to find the cause, not just to remove symptoms.

Will my rankings recover?

Usually yes, once the site is clean and Google’s warnings are removed. Spam pages that were indexed may take some time to disappear.