Security

My WordPress Site Was Hacked – What Now? A Step-by-Step Recovery Guide

Bilal Haider Updated 5 min read

My WordPress Site Was Hacked - What Now? A Step-by-Step Recovery Guide

Strange redirects, spam pages in Google, a browser warning, or an email from your host saying your account is suspended: finding out your website was hacked is stressful. The key is to work through it calmly and in the right order. This guide follows the official WordPress.org recovery advice and adds the practical details business owners usually need.

If you need help right now: skip to Get help. Do not delete everything in a panic, because you may destroy the evidence of how the attacker got in.

Signs your site may be hacked

  • Visitors are redirected to unfamiliar or spam websites.
  • Google results for your site show strange titles or pages you never made.
  • Your browser or Google shows a security warning.
  • Your host suspends the account or emails you about malware.
  • Unknown admin users, plugins or files appear.
  • Your emails are blocked or land in spam.

Some of these can have innocent causes, such as a broken plugin or a DNS mistake, so confirm before assuming the worst. A quick scan with my WordPress security scanner or your host’s scanner is a good first check.

Step 1: Stay calm and document everything

Write down what you noticed, when it started, and what changed recently, such as a plugin install or update. Screenshots help later.

Step 2: Contact your host and scan the site

Tell your hosting provider. Many can scan the server, restore an older copy or explain what they see. Also scan your own computer for malware, since stolen passwords often come from an infected device. WordPress.org’s guide lists plugin scanners and remote scanners for checking a site.

Step 3: Take a backup of the infected site

Before cleaning, save a full copy of the files and the database, clearly labelled as infected. It preserves evidence and protects you if the cleaning goes wrong. Never restore this copy to production later.

Step 4: Change every password and key

  • Reset passwords for WordPress users, hosting, SFTP, the database and related email accounts.
  • Remove admin users you do not recognise.
  • Replace the secret keys and salts in wp-config.php, which logs out everyone (see how to change WordPress security keys and salts, or use my salt key generator).
  • Turn on two-factor authentication.

The official guide also advises changing passwords again after the site is clean.

Step 5: Remove the malware

  • Reinstall WordPress core files (/wp-admin and /wp-includes) from a fresh copy of the same version, ideally over SFTP, not through the dashboard.
  • Reinstall plugins and themes from official sources instead of trying to clean each file.
  • Review .htaccess and key theme files such as functions.php, header.php and footer.php.
  • Look for PHP files in the uploads folder, which should not be there.
  • Check the database for injected scripts, spam links and unknown users.
  • Update WordPress, plugins and themes afterwards.

If you have a clean backup from before the hack, restoring it can be faster. You still need to update everything and close the hole, or the site will be hacked again.

Step 6: Find out how they got in

Common causes include an outdated plugin with a known vulnerability, a nulled (pirated) theme or plugin, a weak or reused password, and an old forgotten site on the same hosting account. Your host’s access logs and the notes you made in Step 1 help. Fix the root cause, or cleaning only buys time.

Step 7: Restore trust with Google and your visitors

  • If Google flagged the site, open the Security Issues report in Google Search Console and request a review once the site is clean.
  • Check for spam pages indexed under your domain and remove them.
  • If your host suspended the account, send them details of the cleanup.
  • Tell customers if their data may have been affected, as required where you operate.
Google Search Console Security issues report showing a green check mark and the message No issues detected
The Security issues report in Google Search Console for this site on November 23, 2026, showing No issues detected. If Google flags your site, this report describes the problem and is where you request a review after cleaning.

Step 8: Prevent it happening again

Put a routine in place: updates, off-site backups, 2FA, a firewall and monitoring. My WordPress security checklist covers the essentials, and regular maintenance makes sure it keeps happening. WordPress.org’s Hardening WordPress guide goes deeper.

Common mistakes

  • Deleting everything before saving a copy.
  • Restoring an old backup without updating plugins and fixing the cause.
  • Changing only the WordPress password and forgetting hosting, SFTP and database access.
  • Installing several “cleaner” plugins that conflict.
  • Not telling customers when their data may be at risk.

Frequently asked questions

How did my WordPress site get hacked?

Most often through an outdated plugin or theme, a pirated add-on, or a weak or stolen password. Only the logs and a proper investigation can confirm your case.

Can I clean a hacked site myself?

Often yes, if you can work with SFTP and the database and you follow the steps above. If it involves a store, customer data, or the hack keeps returning, get help.

How long does cleanup take?

It depends on how deep the infection goes and how quickly you find the entry point. Cleaning is often quick; finding and closing the cause takes longer. I do not promise a fixed time without seeing the site.

Will Google remove the warning automatically?

Typically you need to clean the site and then request a review in Search Console. Timing is up to Google.

Get help

If your site is hacked right now, send me the website address through the contact page or on WhatsApp, and I will tell you honestly what I can do. For a general health check, request a free website audit. WordPress.org’s FAQ: My site was hacked and its support forums are also useful.

Written by Bilal Haider, WordPress designer and developer. Last updated: November 23, 2026.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading

Related articles

Start your project

Let's build a website that wins you clients

Tell me about your business and goals. Within 24 hours you get a clear plan, a fixed-price quote and honest advice, with no pressure and no obligation.