WordPress Site Hacked? Step-by-Step Malware Cleanup & Security Checklist (2026)

Your WordPress site has been hacked. Your pages redirect visitors to spam sites, Google shows a red warning, or strange new pages have appeared. Do not start deleting files at random. Follow the steps below in order to clean the infection and lock the site down.
Most WordPress hacks happen the same way. An attacker finds one weak point — an old plugin, a weak password, or an outdated theme — and uses it to get in. Once inside, they plant hidden files that keep the door open. A real cleanup has two parts: removing the infection, and closing the door it came through.
Step 1: Confirm what happened
Before you change anything, work out exactly what is wrong. Open your site in a private browser window and click through a few pages. Check whether visitors are sent to other websites, whether strange pop-ups appear, and whether your homepage still looks like yours.
Then search Google for your site name. Hacked sites often show spam page titles in the results — medicines, casino sites, or fake products. Check your hosting account for warnings, and look for a Google Search Console email about hacked content. Write down everything you find, with the date you first noticed the problem.
Step 2: Change every password first
Do this before you start cleaning. If the attacker still has a working password, they can undo your cleanup. Change your WordPress admin, hosting, and database passwords, and the password of the email account linked to the site. Use a different, strong password for each one.
Save them in a password manager instead of reusing one password everywhere. If the site has more than one user, check the full user list in the WordPress dashboard. Hackers often create a hidden admin account so they can get back in later. Delete any user you do not recognise, and remove admin rights others do not need.
Step 3: Take the site offline
While the site is infected, every visitor is at risk. They may be sent to scam pages, or their browser may warn them your site is dangerous. That warning alone can cost you customers. Put the site into maintenance mode, or replace it with a simple holding page saying you are fixing a technical problem.
Your hosting company can usually do this for you if you are not sure how. Ask them to block public access while keeping your files untouched. Do not delete the site or reinstall WordPress yet — you still need the infected files to find how they got in, and a rushed reinstall often leaves the hidden backdoor in place.
Step 4: Back up the infected site
Back up the hacked site before you clean it. A full backup of files and database gives you a way back if a cleaning step breaks something. Store it separately and label it as infected, so nobody restores it by mistake.
Also check whether you have a clean backup from before the hack. You need one made before the first sign of trouble, not after the infection. If your host keeps daily backups, ask their support team which is the last clean one.
Step 5: Scan and remove the malware
Now run a full scan. A security plugin can find known malware, but a plugin scan alone is not enough — a hidden infection can slip past it. For a proper cleanup, compare your WordPress files against fresh copies of WordPress, and of each plugin and theme. Any file that does not match the original is suspect.
Look closely at recently changed files, and at files in places they should not be. Hackers hide code in image folders, old theme folders, and files with innocent-sounding names. Remove every infected file, and replace damaged files, plugins, and themes with fresh official copies. Never download a plugin or theme from a random site offering a paid one for free — those copies are a common way sites get hacked.

Step 6: Update everything, remove the rest
Outdated software is the most common way attackers get into WordPress. Update WordPress, every plugin, and every theme to the latest version. Then go through the list and delete anything you do not use. An unused plugin sitting there for a year is a door nobody is watching.
Do the same with themes: keep only the theme your site uses, plus one default theme as a spare. Also check for plugins not updated by their makers for a long time. If a plugin has been abandoned, replace it with one that is still looked after — it will not get fixes when new weaknesses are found.
Step 7: Check for hidden backdoors
Cleaning the visible spam is only half the job — hackers leave code that reopens the door. Look for admin users you did not create, files changed recently that you did not touch, and code hidden in your theme files. Ask your host to check for scheduled tasks you did not set up — attackers use them to reinstall the malware on a timer.
Check the database too, for strange links or scripts in your posts and pages, and new links hidden in your footer or widgets. If you find anything you do not understand, do not guess — ask your host or a security professional to look at it. Guessing wrong is how a site gets hacked a second time.
Step 8: Ask Google to remove the warning
Once the site is clean, Google still needs telling. If Google flagged your site, the red warning will not disappear on its own. Log in to Google Search Console, open the security report, and check what Google found. If the report still lists hacked pages, go back and clean again.
When the report shows no problems, submit a request for review. Google will re-check the site and lift the warning if it is genuinely clean. This review can take a few days. While you wait, check the spam pages are gone from search results, and that your sitemap only lists real pages.
Step 9: The prevention checklist
Cleaning a hacked site is hard work; keeping it clean is mostly habit. Work through this checklist once the site is back online, and repeat the checks every month. Most take only a few minutes each, and together they close the doors attackers use most.
Your monthly security checklist
- Update WordPress, plugins, and themes — and delete anything you do not use.
- Use a different strong password for WordPress, hosting, email, and the database.
- Switch on two-factor login for every admin account.
- Limit login attempts so repeated wrong guesses lock attackers out.
- Take automatic backups and keep one copy away from your hosting.
- Use a firewall that blocks bad traffic before it reaches your site.
- Give each user only the access they need, and remove old accounts.
- Check Google Search Console for warnings at least once a month.
Two habits matter most. First, update promptly — most hacks use weaknesses that already have a fix. Second, keep backups you can actually restore. Test a restore at least once. A backup you have never tested is a hope, not a plan.
When to get professional help
Some infections are simple, and a careful owner can clean them by following the steps above. But if the hack keeps coming back, if you cannot find how they got in, or if customer data may have been exposed, get professional help. A repeated infection means a backdoor is still hiding somewhere.
The same applies if the site takes payments or stores customer details. Tell your customers honestly what happened, and get the cleanup done properly. A hacked shop that keeps taking orders while infected can lose far more than the cost of a cleanup — it can lose its customers' trust.
If you would rather have a professional handle the cleanup, MetaPrime's Emergency Malware Cleanup is ₹4,999 / $119 — complete virus/redirect removal, backdoor cleanup, and Google blacklist recovery request — and the Security Hardening & WAF Shield is ₹8,999 / $199 — full malware cleanup + Cloudflare WAF setup, security headers, and vulnerability patching. See the full details on the Website Security & Malware Removal page.
More from the Blog
- Best AI Automation Tools for Small Business 2026
- Website Development and Speed Optimization Cost in 2026: An Honest Breakdown
- Brevo vs Instantly vs Lemlist: Which Cold Email Tool Is Best in 2026?
- 9 Underrated Free AI Tools for Solo Founders
- Google's Sept 2026 Spam Update: What Changed
- AI Coding Tools: Cursor vs Claude Code in 2026