Your WordPress Site Has Been Hacked. Here’s What to Do First.
The discovery usually happens sideways. A customer emails to say your homepage redirected them to a casino. Google shows Japanese text under your business name in search results. Chrome throws a red warning page. Or your host sends a short, unfriendly email saying your account has been suspended.
The instinct in that moment is to start deleting things. It's the wrong instinct, and acting on it is one of the main reasons hacked sites get reinfected a week later.
Here's a calmer way through the first day.
Step One: Confirm What You're Dealing With
Before changing anything, get a clear picture of the symptoms. Write them down.
Redirects. Do they happen for everyone, or only on mobile, or only for visitors arriving from Google? Many redirects are deliberately selective so the site owner, visiting directly while logged in, never sees them.
Spam in search results. Search site:yourdomain.com on Google. Pages you didn't create, often in other languages or selling pharmaceuticals, indicate injected content.
Browser or blocklist warnings. Check Google Search Console's Security Issues report, which tells you what Google has detected.
Host suspension. Your host's notice usually includes the files they flagged. Keep that email.
Unknown admin users or changed settings. Check the users list in WordPress.
This record matters later, both for cleanup and for proving to Google and your host that the problem has been fixed.
Step Two: Take a Backup of the Hacked Site
It sounds backward. You're backing up an infected site?
Yes. A full copy of the current state, files and database, preserves evidence of what changed and when. If a cleanup goes wrong, it gives you something to return to. And if customer data may have been exposed, it may matter for understanding what happened.
Store it somewhere separate, and don't restore it carelessly.
Step Three: Lock the Doors
Change every password connected to the site: WordPress admin accounts, hosting control panel, FTP or SFTP, and the database user. Do it from a device you trust, not the one you suspect may be compromised.
Also rotate the WordPress security keys and salts in wp-config.php, which forces every logged-in session to end. Review every administrator account and remove anything you don't recognize. Check for application passwords on user profiles, which attackers use to keep access after you've changed the main password.
What Not to Do
Don't just restore an old backup and call it fixed. Unless you know when the compromise started and what the entry point was, an old backup may already contain the backdoor. Even if it doesn't, the vulnerability that let the attacker in is still there, and they'll come straight back.
Don't delete files you don't understand. Malware often hides inside legitimate-looking files or modifies core files. Deleting the wrong thing can break the site without removing the infection.
Don't rely on a single scan. Different scanners catch different things, and a clean result on one tool isn't proof the site is clean.
Don't request a Google review yet. If you submit before the site is genuinely clean, the review fails and the next one tends to take longer.
Why Hacked Sites Get Reinfected
This is the pattern that frustrates site owners most. The visible malware is removed, the site looks fine for a few days, then the redirects come back.
It happens for three reasons.
Backdoors were left behind. Attackers rarely rely on one entry point. They plant hidden scripts, sometimes several, in places like uploads folders, inside images or archives, disguised as plugin files, or inside the database. Remove the visible infection but miss a backdoor, and they simply reinstall everything.
Persistence mechanisms survived. Rogue admin users, scheduled tasks, modified .htaccess rules, malicious code stored in database options, or must-use plugins that load automatically. Any one of these can rebuild the infection.
The original vulnerability is still open. An outdated plugin, a nulled theme, a reused password, or a misconfigured server. Fix everything else but not this, and the site will be compromised again by the same route.
Proper wordpress malware cleanup has to address all three, not just whatever is visible on the front end.
Can You Do It Yourself?
Sometimes, yes. If the infection is obvious and limited, you're comfortable working with files and databases, and you have time, a careful owner can clean a site.
It makes sense to bring in help when:
The site handles payments or customer data. The stakes are higher, and there may be obligations around data exposure. Depending on where you and your customers are, data protection rules such as GDPR can require you to report certain breaches within strict time limits, so it's worth taking advice quickly if personal data may have been accessed.
The site keeps getting reinfected. That almost always means something was missed.
You can't find the entry point. Without it, any cleanup is temporary.
The business can't afford downtime. Every day of redirects or blocklist warnings costs traffic, leads and trust.
You're an agency handling a client site. Your reputation is on the line alongside theirs.
A professional wordpress malware removal service works through files, database, users and configuration systematically, removes backdoors and persistence mechanisms, and identifies how the attacker got in.
Getting Back Into Google's Good Books
Cleanup and recovery are two different things. Removing malware fixes the site. Getting warnings lifted is a separate process.
Google Safe Browsing. Once the site is clean, request a review through the Security Issues report in Search Console.
Spam pages in search. Injected pages may linger in search results after removal. Make sure they now return a 404 or 410, and use Search Console's removal tools where appropriate.
Other blocklists. Security vendors maintain their own lists, and some need separate requests.
Google Ads. If ads were disapproved for malicious software, there's a separate appeal process once the site is clean.
Your host. Send them evidence of cleanup and ask them to lift any suspension.
The platforms control their own review timelines, so warnings can take longer to clear than the cleanup itself. That's normal, and it's one more reason to clean thoroughly the first time. Full hacked website recovery means getting through all of these steps, not just making the homepage look normal again.
After the Cleanup
Update everything. WordPress core, themes and plugins. Remove anything you don't use, and never run nulled or pirated themes or plugins.
Set up scheduled scanning so a new infection is caught within a day, not a month.
Monitor for a few days. Reinfections often appear within 48 to 72 hours if anything was missed.
Keep proper backups, stored off the server, and test that you can restore them.
Review who has access. Fewer admin accounts, strong unique passwords, two-factor authentication.
Ask for a written report. If someone cleaned the site for you, a root-cause report gives you a record of what happened and what to fix.
The Bottom Line
The first day after a hack decides whether you're dealing with one incident or a recurring one. Document the symptoms, back up the current state, lock down access, and resist the urge to delete things at random or restore an old backup and hope.
Clean thoroughly, find the entry point, close it, then request reviews. Done properly, it's a bad week. Done in a hurry, it becomes a bad month.


