Finding out your WordPress site was hacked is stressful. Maybe visitors are being redirected to a spam site, Google is showing a red warning, or your host suspended your account. The good news: most hacked WordPress sites can be cleaned up and put back online. The order you do things in matters, so here it is step by step.
Signs your WordPress site was hacked
- Visitors (often only on mobile, or only from Google) get redirected to spam, gambling or pharmacy sites
- Google shows “This site may be hacked” or a full-page red warning
- Admin users you didn't create appear under Users
- Your host emails you about malware, spam sending or suspended hosting
- Strange PHP files in
wp-content/uploads, or files changed that you didn't touch - Search results for your site show pages in other languages or products you don't sell
- A sudden, unexplained drop in traffic
Step 1: Don't panic, and don't delete anything yet
Your first instinct may be to delete the site or reinstall WordPress. Don't. You'll lose the evidence of how the attacker got in, and possibly content you can't get back. Take a full backup of the hacked site first (files and database). Label it clearly so nobody restores it by mistake later.
Step 2: Lock the doors
Change every password connected to the site, from a device you trust:
- All WordPress admin accounts, and remove any admin users you don't recognize
- Your hosting control panel
- SFTP/FTP and SSH accounts
- The database password (then update it in
wp-config.php)
Also regenerate the security keys and salts in wp-config.php. That logs everyone out, including an attacker with a stolen session.
Step 3: Restore a clean backup, if you have one
If you have a backup from before the hack, restoring it is the fastest way back. The hard part is knowing when the hack started. Attackers often get in weeks before anything visible happens. Check file modification dates and your host's logs, and pick a backup from before the first suspicious change. This is where backups kept for 30 days or more earn their keep: a one-week history may not reach back far enough.
Step 4: If there's no clean backup, clean the site
- Reinstall WordPress core from wordpress.org (Dashboard → Updates → Re-install) so core files are known-good.
- Delete every plugin and theme you don't use. Reinstall the rest from fresh copies, not from the hacked site.
- Look for PHP files inside
wp-content/uploads. That folder should hold images and documents, not code. - Check
.htaccessandwp-config.phpfor code you didn't add, especially redirects. - Search the database for injected scripts and spam links, especially in posts and the options table.
- Run a malware scanner to catch what you missed.
Cleaning by hand takes experience. If you're not comfortable reading PHP, this is the step to hand to someone who is. A half-cleaned site usually gets reinfected within days.
Step 5: Close the hole they came in through
Most WordPress hacks come through an outdated plugin or theme with a known vulnerability, or a weak or reused password. Once the site is clean, update WordPress core, every plugin and every theme. Turn on two-factor authentication for admin accounts. If a plugin is abandoned (no updates in a year or more), replace it. Our guide on how often to update WordPress plugins covers a schedule that keeps this from happening again.
Step 6: Get off Google's blocklist
If Google flagged your site, open Google Search Console, go to Security issues, confirm the problems are fixed and request a review. Reviews for hacked content usually take a few days. Also check for spam pages Google indexed during the hack and remove them. If your host suspended the account, send them proof of the cleanup to get it reinstated.
Step 7: Keep watching
Attackers often leave a backdoor so they can come back. For the next few weeks, watch for new admin users, changed files and redirects. Keep daily off-site backups running so the next restore point is always recent.
How to stop it happening again
- Update core, plugins and themes every week, and test the site after
- Keep daily backups stored off your server, for at least 30 days
- Use strong, unique passwords and two-factor login for admins
- Use a firewall and malware scanning
- Remove plugins, themes and admin users you don't need
That list is exactly what our WordPress maintenance plans cover: weekly tested updates, daily off-site backups kept for 30 days, uptime and security monitoring, and malware cleanup for sites we maintain. If you'd rather have someone to call when something breaks, that's what our website support is for.
Frequently asked questions
How do I know my WordPress site was hacked?
Common signs: redirects to spam sites, admin users you didn't create, a Google "This site may be hacked" warning, a host suspension email, strange files in your uploads folder, or a sudden traffic drop.
Can I just restore a backup?
Often, yes, if you have a clean backup from before the hack. But restoring alone leaves the hole the attacker used. Update everything and change every password afterwards, or it can happen again.
How long does it take Google to remove a hacked site warning?
After you clean the site and request a review in Search Console, Google usually reviews it within a few days. Warnings for malware or phishing can take longer.



