Skip to content
HyperDAF editorialMalware & Recovery

WordPress Hacked? A Calm Recovery Playbook

WordPress hacked recovery done right: confirm the breach, contain it, clean every backdoor, restore safely, and lock the door. A calm step-by-step plan.

Malware & RecoveryEditor-curated guide
14 min10 sectionsIntermediate
Before you beginWhat this guide gives you
10Focused sections14Minutes to finishIntermediateExperience level139Article views
Start reading
Table of contents10

The call came at 9 AM on a Monday. A client’s e-commerce site was redirecting every mobile visitor to a scam pharmacy page. Desktop looked fine — which is why nobody had noticed all weekend. By the time the client called, Google had flagged the site and orders had flatlined for two days.

I have been through this more times than I can count. And here is what I have learned: the hack itself is only half the damage. The other half is the panic — rushed decisions, deleted files, “fixes” that make everything worse. The site owners who recover fastest are not the most technical ones. They are the calmest ones.

I am Ahmed Raza, and I have cleaned and recovered hacked WordPress sites for over seven years. I have seen every flavor of compromise: spam redirects, defaced homepages, stolen customer data, sites turned into phishing pages. Every single one was recoverable. Every single one taught me something.

Here is the fear you are feeling right now: “My site is ruined, my business is ruined, and I have no idea where to even start.” I have sat across from that fear many times. So hear this first: a hacked WordPress site is fixable. It is a known problem with a known process. You do not need to be a security expert. You need a calm head and a clear order of operations — which is exactly what this playbook gives you.

In this guide I will walk you through the exact recovery sequence I use on every compromised site: confirm what happened, stop the bleeding, clean the infection (or restore from backup), and lock everything down so it does not happen again. Step by step. No panic required.

Abstract illustration of a cracked shield being repaired by glowing tools, symbolizing calm website recovery.

Here is what this guide covers:

  • Step 0: Breathe, Then Document Everything
  • Step 1: Confirm It Is Actually a Hack
  • Step 2: Stop the Bleeding (Contain It)
  • Step 3: Restore From a Clean Backup (If You Have One)
  • Step 4: Clean the Infection Manually (If You Do Not)
  • Step 5: Reset Every Password and Key
  • Step 6: Close the Door They Came Through
  • Step 7: Get Google’s Warning Removed
  • Frequently Asked Questions
  • Final Thoughts

Ready? Let us get your site back.

Step 0: Breathe, Then Document Everything

Before you touch anything, do two things: calm down, and write down what you see. The next hour of decisions will be much better if you spend the first ten minutes observing instead of reacting.

Open a document and record: what exactly is wrong (redirects? strange content? a Google warning?), when you first noticed it, and anything you changed recently (new plugin? new user? recent update?). These incident notes save hours if you later hire help, and keep you oriented when the stress peaks.

Most recovery mistakes happen in the first hour, made by panicking people: deleting files “that look suspicious” before understanding the infection, restoring a backup without checking its date, changing passwords from an infected computer. Every one of these feels productive and makes things worse. Slowing down to document forces you to think — and thinking is your best security tool right now. One precaution: do not enter passwords on a computer that might itself have malware. If your machine could be compromised, do the password changes from a trusted device.

Step 1: Confirm It Is Actually a Hack

Not every scary symptom is a hack. A white screen after an update is usually a broken plugin, not an intruder. Before starting recovery, confirm what you are dealing with — the fix for a hack and the fix for a broken update are completely different.

Check from the outside first. Open your site in a private window on your phone (not logged in — attackers often hide malicious behavior from admins). Do you see redirects, popups, or content you did not write? Then check how Google sees your site: search “site:yourdomain.com” and look for spammy page titles you never created — a classic sign of injected spam. A red browser warning (“Deceptive site ahead”) is confirmation from an independent source.

Next, look inside. In your WordPress dashboard, check Users for administrator accounts you did not create — attackers love quiet admin accounts with innocent names. Check plugins and themes for anything unrecognized. Then check your files: look in the site root and wp-content/uploads for PHP files that should not be there (uploads should hold images and documents, not executable code).

If you find unfamiliar admins, strange files, or spam in Google’s index, it is a compromise. If everything looks normal but the site misbehaves, run a free external website scanner — it checks your site from the outside for known malware patterns. Either way, you now know what you are fighting.

Abstract illustration of a magnifying glass scanning server files for hidden threats, representing hack confirmation.

Step 2: Stop the Bleeding (Contain It)

Once confirmed, your first job is containment: limit the damage while you plan the cleanup. Think burst pipe — turn off the water before fixing the plumbing. Put the site in maintenance mode or take it offline temporarily. Every hour a hacked site stays live, it can infect visitors and damage your standing with Google. A short, controlled outage is far cheaper than letting the infection run.

Next, tell your hosting provider. Not optional. Your host can check whether other sites on the account are affected, examine server logs for the entry point, and help isolate the account. Ask specifically whether other infections exist and what the logs show.

Then preserve evidence before cleaning anything. Download a full backup of the site as it is right now — infected and all, labeled clearly (“INFECTED — do not restore”) and stored away from clean backups. It shows exactly what the attacker changed, which helps identify the entry point later.

Finally, warn anyone who needs to know. If the site handles customer data, you may have legal obligations to notify affected people — check this early. If you take payments, inform your payment processor.

Step 3: Restore From a Clean Backup (If You Have One)

If you have a clean backup from before the hack, restoring it is usually quicker, safer, and more complete than cleaning by hand. Modern malware plants copies of itself in several places and can rewrite itself after partial cleanup — a known-clean backup sidesteps that entire game.

But “clean” is doing heavy lifting. You need a backup from BEFORE the compromise — not just before you noticed it. Hacks often sit undetected for days or weeks. Check backup dates against your incident notes and pick one comfortably before the first symptom. If your only backups postdate the infection, do not restore them — you would reinstall the malware. Skip to Step 4 instead.

Before restoring, verify the backup: open the archive, confirm the files are there, confirm the database file has real content. If you have never done a restore before, ask your host’s support team to help — there is no prize for doing it alone. For the concepts behind reliable backups, see [manual backups vs backup plugins: what is actually safer](https://hyperdaf.com/manual-backups-vs-backup-plugins-whats-actually-safer/).

After the restore, do NOT skip Steps 5 and 6. This is the mistake that causes reinfection: the backup is clean, but the vulnerability that let the attacker in is still there, and the stolen passwords still work. A restored site with the same open door gets hacked again — sometimes within hours.

One honest note: restoring loses content added after the backup date — orders, comments, posts. Painful, but usually an acceptable trade for a guaranteed-clean site. Document what was lost so you can rebuild it.

Step 4: Clean the Infection Manually (If You Do Not)

No clean backup? Then you clean by hand. Slower, requires care, entirely doable. Work methodically — this is not the step to rush.

Start with a malware scan. Your host may offer one, or use a reputable scanner from the official WordPress directory. The scan gives you a map of infected files. It will not catch everything — treat results as a starting list, not a complete answer.

Then replace what you can with known-clean copies. Download fresh WordPress and replace the wp-admin and wp-includes folders plus all root files except wp-config.php and .htaccess (inspect those two by hand — favorite hiding spots). Reinstall every theme and plugin from its original source, and vet new additions with our [checks before activating any WordPress plugin](https://hyperdaf.com/checks-before-activating-any-wordpress-plugin/). Delete anything unrecognized: unfamiliar plugins, unknown themes, stray PHP files in uploads. When in doubt, compare a file against a fresh download — identical means clean.

Next, clean the database. Search for injected spam links, suspicious script tags, and content you did not write. Remove rogue administrator accounts and demote any legitimate account escalated to administrator without your knowledge.

Finally, check the hiding spots: scheduled tasks you did not create (WordPress cron and hosting cron), the .htaccess file (a favorite for redirect hacks), and must-use plugin folders. Malware survives cleanup most often through one forgotten backdoor here. When you think you are done, scan again — then scan once more the next day. Reinfection within 24 hours means you missed something.

The official WordPress documentation has a thorough [FAQ for hacked sites](https://wordpress.org/documentation/article/faq-my-site-was-hacked/) that walks through this same process with additional technical detail.

Abstract illustration of clean glowing files replacing corrupted ones in a server rack, symbolizing manual malware cleanup.

Step 5: Reset Every Password and Key

Whether you restored or cleaned by hand, assume every credential the site touched is compromised. Tedious. Do it anyway — skipping this is the number one cause of getting hacked twice.

Change, in this order: all WordPress user passwords (force a reset for everyone, administrators first), hosting panel password, FTP/SFTP password, database password (update wp-config.php to match), and any API keys connected to the site (payment gateways, email services). Strong, unique passwords each — a password manager makes this painless.

Then reset WordPress’s secret keys and salts in wp-config.php. These secure login cookies; if the attacker copied them, they can forge valid sessions even after password changes. Replace all eight values with fresh ones — every existing login session is invalidated instantly, including the attacker’s.

Enable two-factor authentication on every account that offers it — WordPress admins, hosting panel, email. A stolen password alone is then no longer enough to get in. It is the highest-value security upgrade most site owners never enable, and recovery is exactly the right moment.

Do all of this from a clean computer. New passwords typed into a machine with a keylogger just get handed to the attacker.

Step 6: Close the Door They Came Through

A clean site with the same vulnerability is waiting to be hacked again. Now find and fix the entry point.

Update everything: WordPress core, every theme, every plugin. Then delete everything unused: inactive themes, inactive plugins, forgotten uploads. Every piece of unused code is a potential door. The vast majority of WordPress compromises come through outdated plugins and themes — not core. Learn to install them properly with [how to install WordPress plugins safely](https://hyperdaf.com/how-to-install-wordpress-plugins-safely/): fewer plugins, updated plugins, is most of prevention.

Harden the basics. Confirm file permissions (files 644, folders 755). Remove the default “admin” username if it still exists. Limit login attempts against brute force. Keep daily backups running to an offsite location — recovery is only as good as your last clean backup. Our [safe WordPress update checklist](https://hyperdaf.com/safe-wordpress-update-checklist/) makes the update routine painless.

Review who has access. Remove old accounts — former developers, ex-employees, that SEO person from two years ago. Give people minimum access: most editors do not need administrator rights. WordPress’s [official guide to roles and capabilities](https://wordpress.org/documentation/article/roles-and-capabilities/) explains exactly what each role can do.

Finally, set up monitoring so the next problem surfaces in minutes, not weeks: uptime monitoring for outages, file-change monitoring for unexpected edits, and a monthly sixty-second check for unfamiliar admin users. Sites that get hacked twice are sites where nobody was watching.

Step 7: Get Google’s Warning Removed

If Google flagged your site (“Deceptive site ahead” or “This site may be hacked” in results), the warning keeps visitors away even after cleanup. You must actively get it removed — it does not lift itself.

First, verify the site is genuinely clean: rescan everything, confirm spam pages are gone from Google’s index (search site:yourdomain.com again), and check no redirects remain. Requesting a review on a still-infected site wastes weeks.

Then use Google Search Console — free, and the channel Google uses to talk to site owners. In the Security Issues report you will see exactly what Google found. After cleanup, click “Request Review” and describe what you fixed. Reviews typically take a few days to a few weeks. Be patient, and do not request again until you hear back — repeated requests slow the process.

While you wait, check listings for lingering damage. Attacker-created spam pages may persist in results until Google recrawls; you can request recrawls of key pages in Search Console. Rankings usually recover once the warning lifts — Google does not punish victims, but it protects its users until you prove the site is safe.

And tell your audience. A brief, honest note — “we had a security incident, it is resolved, here is what we did” — builds more trust than silence. Customers understand hacks happen. What they do not forgive is learning months later that you knew and said nothing.

Abstract illustration of a reinforced padlock over a glowing website globe with a checkmark, symbolizing a secured recovered site.

Frequently Asked Questions

How do I know for sure my site was hacked? Look for the classic signs: redirects to strange sites, spam content you did not create, unfamiliar administrator accounts, a Google security warning, or PHP files in your uploads folder that should not be there. One strange symptom might be a bug; three together is a compromise.

Should I clean the hack myself or hire someone? If you have a clean backup and can follow this playbook, most site owners can recover themselves. Hire help when there is no clean backup and manual cleanup feels beyond you, or when customer data was involved and you need professional certainty. A botched self-cleanup that gets reinfected costs more than professional help.

Will being hacked hurt my Google rankings permanently? No — Google does not permanently punish hack victims. The security warning suppresses traffic while active, which feels like a penalty but is not one. Once the site is clean and passes review, the warning lifts and rankings typically recover. The longer the hack runs before cleanup, the longer recovery takes.

How did I get hacked if everything was up to date? Updates close known holes, but stolen passwords (reused from another breach or phished), a compromised hosting account, or pirated themes/plugins with built-in backdoors can bypass fully-updated software. That is why Step 5 (passwords) and Step 6 (access review) matter as much as updates.

What is the one thing that prevents most hacks? No single thing — but boring basics done consistently come closest: everything updated, unused code deleted, strong unique passwords with two-factor authentication, and daily offsite backups. Most compromised sites I clean were missing at least two of those four.

Final Thoughts

That Monday-morning call — the pharmacy redirects, the Google warning, the flatlined orders — ended fine. Contained by noon, clean backup restored by evening, everything reset that night, warning lifted nine days later. The client lost a week of sales and gained a security routine they still follow. Bad, but not the end of the world — never is, when you work the playbook instead of the panic.

Here is what I want you to carry from this guide: hacking is not a verdict on you. WordPress powers over 40% of the web (W3Techs, 2026), making it the most targeted platform on earth — being attacked is statistical inevitability, not personal failure. What matters is whether you have a calm, practiced response. Now you do.

So do not wait for the Monday-morning call. This week: check your users list for strangers, update everything, turn on two-factor authentication, confirm your backups are real and offsite. Thirty minutes of prevention beats thirty hours of recovery, every time.

Have you been through a hack? Share what worked in the comments — I read every one, and your story might help the next person who lands here at 9 AM on a Monday, panicking. And if you have not been hacked yet, consider this your warning to do the boring work now. For prevention and recovery, read WordPress security best practices, the 3-2-1 backup strategy, how to test backups with restore drills, backup failure causes and fixes, and how to restore a single file.

Written by

Ahmed Raza

Ahmed has spent 9 years building high-traffic WordPress sites and contributing to core performance discussions. He writes about site architecture, scaling, and the engineering decisions behind fast websites.

5 published articles
View all articles

Related articles

View all articles

4 comments

Join the discussion

Your email address will not be published. Required fields are marked *

Keep comments relevant and respectful.