WordPress Site Hacked? How to Clean It, Recover Your Rankings and Stop It Happening Again
Spam redirects, strange admin users or a "This site may be hacked" warning in Google? Here is a calm, step-by-step plan to clean a hacked WordPress site, recover your search traffic and lock it down.
Newon Lab Team
Newon Lab

How do I know if my WordPress site is hacked?
Common signs are redirects to spam or adult sites, admin users you did not create, Japanese or pharma pages in Google results, a browser or Google warning, sudden hosting suspension, or files changed that you did not touch.
Key takeaways
- Signs your WordPress site has been hacked
- Step 1: Don't panic and don't delete everything
- Step 2: Change every password
- Step 3: Find and remove the malware
- Step 4: Clear Google warnings and recover rankings
- Step 5: Close the door so it doesn't happen again
- When it's time to rebuild instead of patching
- Mistakes that lead to reinfection
- An illustrative example
Few things feel worse than opening your own website and landing on a spam page. A hacked WordPress site can redirect visitors, steal form data, get your hosting suspended and, if Google spots it, show a warning in the search results that kills your traffic.
WordPress powers a huge share of the web, which makes it a popular target. In most cases the cause is ordinary: an outdated plugin, a nulled theme, or a reused password. Here's how to clean it up properly.
Signs your WordPress site has been hacked
- Visitors, especially on mobile or from Google, are redirected to spam, gambling or adult sites
- Google shows "This site may be hacked" or Chrome shows a red warning page
- Search results show pages you never created, often in Japanese or selling pharmaceuticals
- New administrator accounts you don't recognize
- Your host suspends the account for malware or sending spam email
- The site is suddenly slow, or files have changed that no one touched
Step 1: Don't panic and don't delete everything
Take a full backup of the files and database as they are now. It sounds strange to back up a hacked site, but it preserves evidence and protects you if a cleanup step goes wrong. Then turn on maintenance mode or temporarily restrict access so visitors aren't exposed.
Step 2: Change every password
Assume all credentials are compromised: hosting control panel, SFTP/SSH, the database user (update wp-config.php to match), every WordPress administrator, and the email account linked to the site. Generate new security keys and salts in wp-config.php so existing logins are kicked out.
Step 3: Find and remove the malware
- Scan with a reputable security plugin or server-side scanner to locate infected files.
- Replace WordPress core with a fresh copy of the same version, keeping only
wp-contentandwp-config.php. - Reinstall plugins and themes from official sources. Delete anything you don't use and anything "nulled" or pirated, which are frequent sources of backdoors.
- Check the uploads folder for PHP files; it should contain media, not code.
- Inspect
.htaccess,wp-config.phpand the database (especiallywp_optionsandwp_posts) for injected scripts and spam links. - Remove unknown users and review every remaining admin.
Step 4: Clear Google warnings and recover rankings
Open Google Search Console and check the Security Issues and Manual Actions reports. Once the site is clean, request a review. Use the Removals tool and correct status codes (410 or 404) for spam URLs the hackers created, and submit a fresh sitemap so Google recrawls your real pages.
Step 5: Close the door so it doesn't happen again
- Keep WordPress, themes and plugins updated, and remove abandoned plugins
- Turn on two-factor authentication for all admin users
- Use a web application firewall and limit login attempts
- Give each person their own account with the lowest role they need
- Disable file editing in the dashboard (
DISALLOW_FILE_EDIT) - Run automatic off-site backups daily and test a restore
- Use secure hosting with up-to-date PHP
When it's time to rebuild instead of patching
If the site has been reinfected several times, runs dozens of old plugins, or is too slow to compete, a rebuild is often cheaper than repeated cleanups. A modern custom website or a lean, managed WordPress install with a proper security setup removes most of the attack surface.
Mistakes that lead to reinfection
- Only deleting the visible spam. Attackers usually leave a backdoor file so they can return. If you don't find how they got in, the spam comes back.
- Restoring an infected backup. Check the backup date against when the problems started.
- Keeping "just in case" plugins. Deactivated plugins can still be exploited if their files are on the server. Delete what you don't use.
- Sharing one admin login. Give every person their own account so you can see who did what and remove access cleanly.
- Skipping the Search Console review. Even after a perfect cleanup, Google's warning can stay until you request a review.
An illustrative example
A typical case: a small business site starts sending mobile visitors from Google to a gambling page, while the owner sees nothing wrong on desktop. The cause is often an outdated slider or form plugin. The recovery is to back up, rotate every password, replace core and plugin files with clean copies, remove a hidden PHP file in the uploads folder, update everything, then request a review in Search Console and monitor the Security Issues report for the following weeks.
Frequently asked questions
How do I know if my WordPress site is hacked?
Common signs are redirects to spam or adult sites, admin users you did not create, Japanese or pharma pages in Google results, a browser or Google warning, sudden hosting suspension, or files changed that you did not touch.
Is restoring a backup enough?
Only if the backup is from before the infection and you also close the hole that let attackers in. Otherwise the same vulnerability is used again within days.
How long until Google removes the hacked warning?
After you clean the site and request a review in Search Console, reviews for hacked content often finish within days, but it can take longer. Cleaning thoroughly the first time avoids a failed review.
Get it fixed without the guesswork
If your website has been hacked or keeps getting reinfected, you don't have to work through this list alone. Newon Lab's cybersecurity team cleans infected sites, removes backdoors, clears Google warnings and hardens your hosting so it stays clean. Start with a free website and SEO audit, or book a free 30-minute consultation and we'll tell you exactly what's wrong and what it will cost to fix. You can also compare our transparent pricing plans before you talk to anyone.
Key facts
- Step 1
- Take a full backup of files and database for evidenceNewon Lab analysis
- Step 2
- Put the site in maintenance modeNewon Lab analysis
- Step 3
- Change every password: hosting, SFTP, database, WordPress adminsNewon Lab analysis
- Step 4
- Scan and replace core, theme and plugin files with clean copiesNewon Lab analysis
- Step 5
- Remove unknown admin users, backdoors and injected codeNewon Lab analysis
Last verified 2026-11-02
Frequently asked questions
How do I know if my WordPress site is hacked?+
Common signs are redirects to spam or adult sites, admin users you did not create, Japanese or pharma pages in Google results, a browser or Google warning, sudden hosting suspension, or files changed that you did not touch.
How do I know if my WordPress site is hacked?+
Common signs are redirects to spam or adult sites, admin users you did not create, Japanese or pharma pages in Google results, a browser or Google warning, sudden hosting suspension, or files changed that you did not touch.
Is restoring a backup enough?+
Only if the backup is from before the infection and you also close the hole that let attackers in. Otherwise the same vulnerability is used again within days.
How long until Google removes the hacked warning?+
After you clean the site and request a review in Search Console, reviews for hacked content often finish within days, but it can take longer. Cleaning thoroughly the first time avoids a failed review.
Sources
Ready to Build Something Great?
Newon Lab builds premium digital products and provides full-stack agency services that deliver real results.
Comments (2)
Excellent article! Really well explained.
This changed how our team thinks about the problem. Thank you.
Leave a Comment
About the Author
Newon Lab Team
Newon Lab Expert
Practitioner and writer at Newon Lab covering technology, architecture, and digital strategy.
Article Analytics
Need a Custom Solution?
Our team builds bespoke digital products and full-stack applications.
Get Free Consultation