Skip to content

Tutorials Security Intermediate1 min read

What to Do If Your Website Is Hacked

A calm, step-by-step plan to recover a hacked website: contain the damage, find and remove malware, close the hole, and get off blocklists.

By ZSOLNET Editorial Team Updated

Key takeaways

  • Change every password first — hosting, cPanel, FTP, database and admin users.
  • Restoring a clean backup is often faster than cleaning file by file.
  • Find how the attacker got in, or it will happen again.

1. Contain

  • Change passwords for your hosting client area, cPanel, FTP/SFTP accounts, the database user and every administrator account. Enable 2FA.
  • Take a copy of the infected site (files and database) for investigation before you change anything else.
  • If the site is redirecting visitors to malware, put up a maintenance page.

2. Clean

Fastest: restore a backup from before the infection, then update everything.

If there’s no clean backup:

  1. Reinstall WordPress core files from a fresh download (keep wp-content and wp-config.php).
  2. Reinstall every plugin and theme from the official source; delete ones you don’t use.
  3. Search wp-content/uploads for .php files — there normally shouldn’t be any.
  4. Review wp-config.php and .htaccess for code you didn’t add.
  5. In the database, remove unknown administrator users and check for injected <script> tags.

3. Close the hole

Common entry points: an outdated plugin, a nulled theme, a reused password, or an infected local computer. Update everything, remove anything unused, and scan your own devices.

4. Recover your reputation

  • Request a review in Google Search Console if Google flagged the site.
  • Check whether your server’s IP was used to send spam and is blocklisted.
  • Keep monitoring logs for a few weeks.

Frequently asked questions

How do I know my site is hacked?

Common signs: redirects to spam sites, a browser 'Deceptive site' warning, unknown admin users, strange files, a sudden traffic or email spike, or a warning from your host or Google.

How do I get my site off Google's warning list?

After cleaning, open Search Console → Security & Manual Actions → Security issues, and request a review. Reviews usually complete within a few days.

Share X LinkedIn Facebook

Log in to your account

Manage your domains, hosting and invoices in one place.

Secure connection straight to the ZSOLNET client area.

Open the ZSOLNET dashboard

No account yet?