AI Overview
Signs a WordPress site is hacked include unknown admin users, redirects to spam sites, spam pages in Google, PHP files in wp-content/uploads and unknown scripts. Back up the hacked site, change every password and security key, then restore a clean backup or reinstall core, plugins and themes from clean copies and close the hole they used.
Key takeaways
- Watch for unknown admins, mobile-only redirects, spam pages in Google, PHP in uploads and unknown scripts.
- First hour: back up the hacked site, change every password, replace the security keys and call your host.
- Clean by restoring a backup from before the hack, or reinstall core, plugins and themes from clean copies.
- Find and fix the entry point, usually an outdated plugin or a reused password.
- Monitoring for new admins, changed settings and new scripts catches the next attempt in minutes.
Free WordPress plugin
Know which plugin update broke your site.
The free MyKavo plugin watches your site through every plugin, theme and core update, and tells you which one caused a change, before your visitors find it.
- Records every plugin, theme and WordPress update
- Checks your key pages right after each update and names the one that broke something
- One-click rollback when an update goes wrong, free
- Changes, alerts and before-and-after proof inside wp-admin
Free on WordPress.org · WordPress 6.2+ · PHP 7.4+ · The check after each update comes with every paid plan and the 14-day Pro trial
Summarize with AI
Opens the assistant in a new tab with a link to this post.
On this page
A hacked WordPress site rarely announces itself. Sometimes Google shows a red warning or your host suspends the account. More often, the signs are small: a new admin user nobody created, spam pages in Google results, visitors on phones being redirected to another site. The longer it goes unnoticed, the harder the clean-up and the bigger the damage to your search rankings.
This guide covers the signs your WordPress site has been hacked, what to do in the first hour, how to clean it step by step, and how to catch the next attempt early.
Signs your WordPress site has been hacked#
- Unknown administrator accounts under Users, or an admin email you did not set.
- Redirects to spam, gambling or fake pharmacy sites, often only for mobile visitors or visitors coming from Google, so you never see it yourself.
- Spam pages in Google. Search for site:yourdomain.com and look for pages in other languages or about products you do not sell (the "Japanese keyword hack" and pharma hacks).
- Browser or Google warnings: "Deceptive site ahead" or "This site may be hacked" in search results.
- New or changed files, especially .php files inside wp-content/uploads, or unfamiliar files in the site root.
- Unknown scripts in your pages, typically injected into the header or footer.
- Your host suspended the site or reports high outgoing email (your site is sending spam).
- Changed settings: the site address, permalinks or "Discourage search engines" changed without anyone doing it.
- Sudden slowness or high CPU, sometimes from injected crypto miners or spam scripts.
What to do in the first hour#
- Do not panic, and do not delete things at random. You need evidence to find how they got in.
- Take a backup of the hacked site as it is now: files and database. It is evidence, and a fallback if the clean-up goes wrong.
- Change every password: all WordPress administrators, hosting control panel, SFTP, database and the email account tied to the admin.
- Log everyone out by changing the security keys in wp-config.php (generate new ones at api.wordpress.org/secret-key/1.1/salt/).
- Put up maintenance mode or ask your host to isolate the site if it is redirecting visitors or serving malware.
- Tell your host. Many hosts have a security team and server logs that show how the attacker got in.
Try it on your site · free
Check your own page's meta tags
Title, description, canonical and robots - including an accidental noindex - in a few seconds.
How to clean a hacked WordPress site#
Option 1: restore a clean backup (fastest, if you have one)#
If you know roughly when the hack happened, restore a backup from before it. Then update everything and change all passwords, because the hole they used is still there in the old copy. Keep orders or posts created since the backup aside so you can add them back. Our WordPress backup guide covers restores.
Option 2: clean it yourself#
- Scan the site with a security plugin such as Wordfence or Sucuri, or use your host's malware scanner, to list infected files.
- Replace WordPress core files: from Dashboard > Updates, click Re-install, or upload a fresh copy of wp-admin and wp-includes. Never overwrite wp-content or wp-config.php this way.
- Reinstall every plugin and theme from clean copies (WordPress.org or the vendor), rather than trying to clean them line by line.
- Check wp-content/uploads for .php files. Uploads should only contain media; delete any PHP there.
- Check wp-config.php and .htaccess for code you did not add, such as long encoded strings or redirect rules.
- Check the database: unknown administrators in the users table, and injected scripts in posts, widgets and the wp_options table (search for "<script" and "eval(").
- Remove unknown admin users, and reset every remaining user's password.
- Find and fix the entry point: usually an outdated plugin with a known vulnerability or a reused password. Our guide to WordPress vulnerabilities shows how to check.
Option 3: hire a clean-up service#
If the site makes money or the hack keeps coming back, professional clean-up services (Sucuri, Wordfence, Patchstack, many managed hosts) remove malware and close the hole, often within a day.
After the clean-up#
- Request a review in Google Search Console if Google flagged the site (Security & Manual Actions > Security issues), and remove spam URLs with the Removals tool.
- Check your key pages and checkout work, since reinstalling plugins can change things. If something broke, see our guides to the WordPress critical error and a WordPress plugin conflict.
- Watch for the hack coming back for the next few weeks. Reinfection usually means a backdoor was missed.
How to stop it happening again#
- Keep WordPress, plugins and themes updated, and remove what you do not use.
- Use strong, unique passwords and two-factor login for every admin, and keep the number of admins small.
- Keep off-site backups, and test that you can restore them.
- Use a firewall, from your host, Cloudflare or a security plugin.
- Monitor your site for the changes a hack makes, so you hear about it in minutes.
Know within minutes if your site is changed#
Hacks are changes: a new admin, an injected script, a redirect, a spam page. Spotting them early is the difference between a quick fix and weeks of cleaning up search results. The free MyKavo WordPress plugin watches for exactly that:
- Silent-disaster alerts (free). A new administrator, a changed admin email, a changed site address or permalinks, or "Discourage search engines" switched on: a red notice on every wp-admin screen. Paid plans also get an instant email or Slack alert from MyKavo.
- Script monitoring. MyKavo tracks the third-party scripts on your monitored pages and alerts you when an unknown one appears.
- Page changes with before-and-after screenshots. New content, changed titles, redirects and pages that start returning errors are flagged and ranked by severity.
- Known security issues. Every plan sees how many installed plugins have a known vulnerability; paid plans see which plugin and the version that fixes it.
Summary#
Look for unknown admins, redirects, spam pages in Google, PHP files in uploads and unknown scripts. If you are hacked: back up the hacked site, change every password and security key, then restore a clean backup or reinstall core, plugins and themes from clean copies and remove anything that should not be there. Find and fix the entry point, ask Google to review the site, and set up monitoring so the next attempt is caught in minutes.
Frequently asked questions
How do I know if my WordPress site has been hacked?
Common signs are administrator accounts you did not create, redirects to spam sites (often only on mobile), spam pages when you search site:yourdomain.com, Google or browser warnings, PHP files in wp-content/uploads, unknown scripts in your pages, and settings that changed on their own.
What should I do first if my WordPress site is hacked?
Back up the site as it is, change every password (WordPress admins, hosting, SFTP, database, email), replace the security keys in wp-config.php to log everyone out, and contact your host. Then clean the site or restore a clean backup.
Can I fix a hacked WordPress site myself?
Often, yes: restore a clean backup, or reinstall WordPress core, plugins and themes from clean copies, delete PHP files from uploads, remove unknown admins and injected code, and fix the plugin or password that let the attacker in. For a business-critical site or a hack that keeps returning, a professional clean-up is worth it.
How do hackers get into WordPress sites?
Mostly through plugins with known vulnerabilities that were not updated, and through weak or reused passwords. Nulled (pirated) themes and plugins with hidden backdoors are another common route.
Will a hacked site hurt my Google rankings?
It can. Google may show a warning, remove spam pages slowly, or apply a security manual action. Clean the site quickly, request a review in Search Console and remove spam URLs to recover.
How can I get alerted if my site is hacked?
Use a monitoring tool that watches for the changes a hack makes: new administrators, changed settings, unknown scripts, redirects and changed pages. The free MyKavo WordPress plugin shows these in wp-admin, and paid plans alert you by email or Slack.
Write for MyKavo
Know website monitoring, WordPress or SEO from real work? Pitch us a guide. You keep a byline with one link to your site. Read the guidelines
Get alerted when your site breaks. Free, no card.
Start free