Few things feel worse for a business owner than discovering that their website has been hacked. Maybe a customer calls about strange pop-ups, maybe Google shows a red warning screen, or maybe the site simply starts redirecting visitors to a pharmacy shop in another country. In that moment, the questions come fast. How bad is it, what has been stolen and how do you get the site back without making things worse?
A hacked WordPress site can almost always be recovered, but the order of the steps matters. Rushing to delete files or restoring a backup without finding the cause often leads to the same infection returning a few days later. This guide walks through the full process, from the first signs and the first hour to the cleanup, the security fixes and getting Google to trust the site again. It is written for business owners who want to understand what is happening and for agencies that handle security incidents for clients.
How to Tell Your Site Has Been Hacked
Some hacks are obvious. The homepage shows a message from the attacker, the site redirects every visitor to a spam domain or the browser displays a full-screen warning before the page loads. Others are designed to stay hidden for as long as possible, because the attacker earns more from a site that keeps working normally while secretly serving spam or stealing data.
Common signs include:
- Unexpected redirects, often only for mobile visitors or only for people arriving from Google, so the owner never sees them.
- Spam pages in Google, such as casino, pharmacy or adult content under your domain, which you can find by searching `site:yourdomain.com` with a few spam keywords.
- Security warnings in browsers or a message in Google Search Console about hacked content or malware.
- New admin users you did not create, or existing users with changed roles.
- Unfamiliar files in the WordPress folders, especially PHP files in the uploads directory, or files with random names.
- Sudden slowness or high server usage, which can mean the site is sending spam emails or being used to attack other sites.
- Your hosting company suspending the account or warning you about malicious activity.
Google’s Safe Browsing site status tool is a quick way to check whether Google has flagged your domain. If it has, visitors using Chrome, Firefox and Safari may already be seeing a warning, which means every hour counts.
What to Do in the First Hour
When you confirm or strongly suspect a hack, the first goal is to limit the damage, not to fix everything. Calm, careful steps in the first hour make the cleanup much easier later.
Start by taking a full backup of the hacked site, files and database together, and store it somewhere separate. It may seem strange to back up an infected site, but that copy is evidence. It shows what the attacker changed and when, and it gives you a fallback if something goes wrong during the cleanup. Never overwrite your older clean backups with this one.
Next, change every password that touches the site: WordPress administrators, hosting control panel, SFTP or SSH accounts, the database user and any connected email accounts. Do this from a device you trust. If the attacker has access to an admin account, changing the password alone is not enough, so also log out all sessions by updating the security keys in `wp-config.php`. WordPress provides a secret key generator for exactly this purpose.
If the site is actively harming visitors, for example by redirecting them to scam pages, consider putting it into maintenance mode while you work. A short, honest maintenance page is better for your reputation than a site that infects customers. Finally, let your team and, if needed, your hosting provider know what is happening, so nobody makes changes that destroy evidence or reintroduce the problem.
Find Out How the Attackers Got In
This is the step most rushed cleanups skip, and it is the reason many sites get hacked again within weeks. Removing the malware treats the symptom. Finding the entry point treats the cause. If the vulnerable plugin or stolen password is still there, the attacker simply comes back through the same door.
The most common entry points on WordPress sites are well known. Outdated plugins and themes with published vulnerabilities top the list, followed by weak or reused passwords, nulled premium plugins downloaded from unofficial sites and abandoned plugins that no longer receive security fixes. Less often, the problem is at the server level: outdated PHP, wrong file permissions or another compromised site on the same shared hosting account.
| Likely Entry Point | Where to Look | Typical Fix |
|---|---|---|
| Vulnerable plugin or theme | Plugin versions compared with vulnerability databases | Update, replace or remove the plugin |
| Stolen or weak password | Login logs, new admin users, password reuse | Reset passwords, add two-factor authentication |
| Nulled premium plugin | Plugins installed from unofficial sources | Delete and reinstall from the official vendor |
| Abandoned plugin | Plugins with no updates for a year or more | Replace with a maintained alternative |
| Shared hosting neighbor | Other sites on the same account | Isolate sites, clean all of them |
| Outdated server software | PHP version, server configuration | Update PHP and harden the server |
Public vulnerability databases such as the Patchstack database let you check whether any plugin version on your site has a known security flaw. Server access logs are also valuable, because they often show the exact request the attacker used, such as a call to a vulnerable plugin file or repeated login attempts before a successful one.
Clean the Infection Properly
With the entry point identified, the actual cleanup can begin. The aim is to remove every piece of malicious code while keeping your content, design and data intact. A thorough cleanup covers several layers of the site, because attackers rarely put their code in only one place.
The first layer is WordPress core. Core files should be identical to the official release, so any difference is suspicious. Developers can use the WP-CLI command core verify-checksums to compare every core file with the official checksums, and the safest fix is to replace core entirely with a fresh copy of the same version. Your content lives in the database and the `wp-content` folder, so replacing core does not touch it.
The second layer is plugins and themes. Delete any you do not use, then reinstall the active ones from fresh downloads rather than trying to clean individual files. Premium plugins should come from the vendor’s official account. Custom themes need a careful manual review, because a fresh download is not available.
The third layer is the uploads folder and other content. The uploads directory should contain media files, not PHP scripts. Any PHP file found there deserves close inspection, and most can be deleted. Attackers also like to hide backdoors, small scripts that let them return later, in places that look legitimate, such as files named like WordPress core files or code added to the top of `wp-config.php`.
The last layer is the database. Hacks often inject spam links or malicious JavaScript into posts, widgets and options, and create hidden admin users. Check the users table for accounts you do not recognize, search post content and options for script tags and suspicious URLs, and review any scheduled tasks that were added recently.
Restore From a Backup or Clean in Place
Many people ask whether it is easier to simply restore an older backup. Sometimes it is, but only if three conditions are true. The backup must be from before the infection started, you must know how the attacker got in, and you must be able to fix that entry point immediately after restoring.
The difficulty is the first condition. Many hacks sit quietly for weeks before anyone notices, so the most recent backups are often infected too. Restoring an infected backup feels like progress but changes nothing. Even a clean backup can lose orders, form entries and content added since it was made, which matters for online stores and lead generation sites.
In practice, the best approach is often a combination: restore clean core, plugin and theme files from official sources, keep the current database after cleaning it, and use an older backup as a reference to compare files and spot anything that should not be there. A reliable backup strategy with daily copies and at least 30 days of history makes this far easier, because it gives you clean versions to compare against.
Close the Door Behind You
Once the site is clean, the next job is to make sure the same attack cannot happen again. This is where cleanup turns into protection. Every fix should be tied to what you found in the investigation, plus the basic hardening steps every WordPress site should have.
- Update everything: WordPress core, all plugins and themes, and the PHP version on the server.
- Remove what you do not use: inactive plugins and themes still contain code that can be exploited.
- Enforce strong passwords and two-factor authentication for every administrator and editor.
- Review user roles and give each person the lowest role that lets them do their job.
- Set correct file permissions and disable file editing in the dashboard by adding `DISALLOW_FILE_EDIT` to `wp-config.php`.
- Add a firewall at the server or application level to block known attack patterns and brute force login attempts.
- Turn on malware scanning so any new infection is caught early.
The official WordPress guide to hardening WordPress covers these steps in more depth. Our own WordPress security checklist turns them into a routine you can follow every month.
Get Google to Trust Your Site Again
If Google detected the hack, your site may show warnings in search results or browsers, and spam pages may still be indexed under your domain. Cleaning the site does not remove these automatically, so the final step is to tell Google that the problem is solved.
Open the Security Issues report in Google Search Console. It lists the problems Google found, such as hacked content, malware or deceptive pages, often with sample URLs. Once you are confident the site is clean and the entry point is closed, use the request a review process from that report. Describe what happened, what you removed and what you changed to prevent it happening again. Reviews for hacked sites usually take a few days.
Spam pages created by the attacker need attention too. If they now return a 404 or 410 status, Google will drop them over time as it recrawls them. For urgent cases, the Removals tool in Search Console can hide specific URLs from results temporarily while that happens. Google’s web.dev guide Help, I think I’ve been hacked explains the full recovery process, including how to check for cloaked spam that only Googlebot can see.
It is also worth checking whether the attacker submitted their own sitemap or verified themselves as an owner in Search Console. Remove any owners and sitemaps you do not recognize, then watch the Page indexing report for the following weeks to confirm that spam URLs are disappearing.
How Webueno Handles Hacked Sites
At Webueno, malware cleanup is handled as a structured process rather than a quick scan and delete. When a request comes in through the platform or by email, our team takes a full backup first, runs a deep scan of files and the database, and works out how the attack happened before removing anything.
The cleanup itself covers malicious code and scripts, backdoors, database injections and core file restoration. We then run a security audit of the plugins, themes, credentials and server configuration that allowed the attack, and finish with a protection setup: firewall configuration, login and access protection, malware scanning and correct file permissions. Every site gets a functionality check and a final security re-scan before the job is closed. You can see the full scope on our malware cleanup page.
For ongoing protection, sites on Webueno hosting can activate the Malware Scanner add-on per website, which continuously monitors for suspicious files and activity and sends alerts when a potential threat appears. Combined with daily offsite backups and The Gatekeeper, our server-level protection that stops many attacks before they reach PHP, it turns security from an emergency into routine maintenance.
For agencies, cleanup work is billed through credits like every other Webueno service, with discounts of up to 21% on larger credit bundles. That means you can offer malware cleanup and protection to your own clients under your brand, with a clear cost per hour and your own margin on top.
Prevention Costs Less Than Recovery
A hacked site costs far more than the cleanup itself. There is lost revenue while the site is down or blocked, lost trust when customers see warnings, lost rankings while Google treats the site as unsafe and hours of stress for everyone involved. Most of that can be avoided with routine work that takes a fraction of the time.
The sites we see recover fastest are the ones that already had good habits in place: regular updates, daily backups with a long history, malware scanning and a clear owner for security. If your site has been hacked, or you want to make sure it never is, create a free Webueno account and submit a request. Our team will take it from there.
Frequently Asked Questions
These are the questions we hear most often from site owners and agencies dealing with a hacked WordPress site.
How Do I Know if My WordPress Site Is Hacked?
Look for unexpected redirects, spam pages in Google, browser or Search Console security warnings, admin users you did not create and unfamiliar PHP files, especially in the uploads folder.
Can a Hacked WordPress Site Be Fully Cleaned?
Yes. A thorough cleanup replaces core, plugin and theme files with clean copies, removes backdoors and database injections, and closes the entry point the attacker used.
Should I Just Restore an Old Backup?
Only if the backup is from before the infection and you can fix the entry point right away. Many hacks stay hidden for weeks, so recent backups are often infected too.
How Long Does It Take to Remove a Google Hacked Warning?
After the site is clean, request a review in the Security Issues report in Search Console. Reviews for hacked sites usually take a few days.
Why Does My Site Keep Getting Hacked?
Usually because the original entry point, such as a vulnerable plugin or stolen password, was never fixed, or a hidden backdoor was left behind during the cleanup.
Will I Lose My Content During Cleanup?
Not with a careful process. Content lives in the database and uploads folder, which are cleaned rather than replaced, and a full backup is taken before any changes.