Key takeaways
- Hour 0 to 1: write down what you see, take a snapshot of the infected site, and call your host. Do not start deleting files yet.
- Hours 1 to 3: change every password (WordPress, hosting, SFTP, database, email), replace the secret keys and remove admin users you do not recognize.
- Hours 3 to 12: restore a known clean backup or rebuild from fresh copies, then update everything and close the hole the attacker used.
- Hours 12 to 24: check Google Search Console’s Security issues report, make spam URLs return 404 or 410, and request a review only when every page is clean.
- Google says a review “can take from a few days to a few weeks”, so the sooner the cleanup is complete, the sooner warnings come off.
If your WordPress site has been hacked, the first job is to stop the damage, not to find the culprit. Work in this order: contain, lock out, clean, close the hole, then tell Google. This guide turns that order into a plan for the first 24 hours.
The steps follow the WordPress.org guide “FAQ My site was hacked” and Google’s Search Console process for hacked sites. If you would rather hand the cleanup to someone, every WPmodo Care plan includes security monitoring and malware removal, from $49 a month. Either way, the plan below tells you what good cleanup looks like.
How do you know your WordPress site has been hacked?
You usually find out from a symptom: a warning in Google, a redirect to a strange site, a new admin user or a message from your host. Confirm at least one clear sign before you act.
WordPress.org lists these as clear indicators of compromise:
- Google, Bing or antivirus tools flag or block your site.
- Your host has disabled the site or reported it for sending spam or attacking other sites.
- Visitors say their antivirus warns them about your site.
- New users, posts or settings you did not create.
- Visible changes on the site: defaced pages, pop-ups or redirects.
Two more are common with spam hacks. Search site:yourdomain.com in Google and look for pages in a language you do not use, or for product names you never sold. And check Google Search Console for a Security issues message.
Hour 0 to 1: what should you do first when WordPress is hacked?
Write down what you see, take a full copy of the hacked site, and contact your host. These three steps protect your evidence and your options.
- Document it. Note what you saw, the time and time zone, and anything you changed recently: a new plugin, a theme edit, a new user. WordPress.org calls this the start of your incident report.
- Take a snapshot of the infected site. Download the files and the database as they are now. It feels odd to back up malware, but if a cleanup goes wrong you still have a reference copy.
- Find your last clean backup. Check your backup tool or host for copies from before the first symptom. Do not restore yet.
- Call your host. On shared hosting, other sites may be affected. Your host can also confirm whether it is a hack or an outage, and may already be helping.
- Decide whether to take the site offline. If the site is sending visitors to malware or phishing pages, put up a maintenance page or ask the host to suspend it. If it only has hidden spam pages, keeping it online while you clean is usually fine.
Do not delete files yet
Deleting suspicious files before you have a snapshot destroys the evidence you need to find how the attacker got in. Copy first, clean second.
Hours 1 to 3: how do you lock the attacker out?
Change every password that touches the site, then force everyone to log in again. Assume the attacker has any login that was stored on or near the site.
- Scan your own computer. WordPress.org warns that many infections start on the site owner’s laptop, where malware steals saved logins. Run a full antivirus scan before typing new passwords.
- Change every access point. WordPress admin accounts, the hosting control panel, SFTP or FTP, the database user, and the email account that receives password resets. Use long, unique passwords from a password manager.
- Replace the secret keys. Generate a new set of keys and salts from the WordPress.org key generator, and paste them into
wp-config.php. This logs out everyone, including the attacker. - Review users. In the Users screen, remove any administrator you do not recognize. If you cannot log in at all, your host’s database tool can reset your user.
- Check Search Console owners. Google notes that attackers sometimes add themselves as site owners in Search Console. Remove any owner you do not know.
- Turn on two-factor login for every administrator account as soon as you can.
Why move this fast? Patchstack’s State of WordPress Security in 2026 found that about half of high-impact vulnerabilities are exploited within 24 hours of disclosure. Automated attacks do not wait for office hours.

Hours 3 to 8: should you restore a backup or clean the site?
Restore a backup if you have one from before the hack and can accept losing changes made since. Clean the site in place if no clean backup exists or the content since then matters too much to lose.
| Situation | Best route | Watch out for |
|---|---|---|
| Clean backup from before the first symptom, few changes since | Restore it, then update everything | The hole is still open until you update or remove the weak plugin |
| Backup exists, but you are not sure when the hack started | Restore, then scan the restored site | Attackers often sit quietly for weeks, so a recent backup may be infected |
| No backup, or the store has orders since | Clean in place | Hidden backdoors that bring the infection back |
If you clean in place, follow the WordPress.org order:
- Scan with more than one tool. Use a security plugin inside WordPress and a remote scanner from outside. Each finds different things.
- Replace WordPress core with fresh copies of the same version. Download that version from WordPress.org and upload
/wp-adminand/wp-includesover SFTP, replacing the old folders. WordPress.org advises against the dashboard reinstall button, because it overwrites files but leaves new ones behind. - Verify core files. If you have WP-CLI,
wp core verify-checksumscompares your core files with WordPress.org’s official copies. - Reinstall plugins and themes from their official sources. Delete any you do not use.
- Check the usual hiding places. The
.htaccessfile,wp-config.php,index.php, the theme’sheader.php,footer.phpandfunctions.php, themu-pluginsfolder, and any PHP file insidewp-content/uploads, which should normally hold only media. - Check the database. Look at the site address settings, the administrator list and recent posts for spam links or scripts.
Our guide to WordPress backups and restores covers restoring files and the database step by step.
Hours 8 to 12: how do you stop it happening again?
Find and close the way in, update everything, then change the passwords a second time. A cleanup without this step often ends with the site hacked again within days.
- Update WordPress, every plugin and every theme. WordPress.org notes that older versions are more prone to hacks than newer ones.
- Look for the entry point. Your host’s access logs show which files were requested around the time the symptoms started. A recently disclosed flaw in one of your plugins is the most common suspect.
- Remove abandoned plugins. Patchstack reports that 46% of vulnerabilities had no fix from the developer at the time they were made public. If a plugin has no fix, replace it.
- Change the passwords again. WordPress.org is specific: change them once when you find the hack, and again after the site is clean.
Longer-term hardening, such as file permissions and login limits, belongs in your WordPress security checklist. Today, focus on the hole that was actually used.
Hours 12 to 24: how do you get Google to remove the hacked warning?
Fix every affected page, make spam URLs return an error, and only then request a review in Search Console. A request sent too early slows everything down.
- Open the Security issues report. In Google Search Console, it lists hacked content, malware and deceptive pages Google has found, with sample URLs.
- Find every spam page. Use
site:yourdomain.comsearches, the Pages report and the sample URLs. Remove any sitemap the attacker added. Google’s guide to the Japanese keyword hack covers sitemaps and hidden spam in detail. - Make spam URLs return 404 or 410. Google’s documentation says that for a page returning one of these codes, “the indexing pipeline removes the URL from the index if it was previously indexed” (Google Search Central).
- Do not block spam URLs in robots.txt. If Google cannot crawl a URL, it cannot see the 404 or 410, and the spam stays listed longer.
- Request a review only when every page is clean. Explain the problem, the steps you took and the result.
“Fixing the issue on just some pages will not earn you a partial return to search results.”
Google Search Console Help, Security issues report
Google says a review can take from a few days to a few weeks. It also warns that requests sent before the problem is fixed can lengthen the next review, or get a site marked as a repeat offender.

What did we do when wpmodo.com had spam URLs?
Our own domain is a real example. Before WPmodo moved wpmodo.com to its current server, the domain had been hacked, and Google had indexed spam pages from that hack.
The spam was Japanese-language product pages on addresses such as /?G=4643234. After the move, the site itself was clean, but those URLs were still in Google’s index. Here is what we did:
- We collected every spam URL pattern listed in Google Search Console.
- We made every one of those patterns return 410 Gone, with a noindex header, through a small must-use plugin.
- We left robots.txt open for those URLs on purpose, so Google can crawl them and see the 410.
- We sent old pages from the previous site that still had value to their new equivalents with 301 redirects.
We checked on November 6, 2026: a request for wpmodo.com/?G=4643234 returns 410 Gone. The lesson for your own cleanup is that removing the malware is only half the job. The spam URLs need a clear “gone” signal before they drop out of search.
What should you do after the first 24 hours?
Watch the site closely for 30 days, keep the routine going, and deal with any customer data that may have been exposed.
- Scan daily for two weeks. Reinfection usually shows up within days if a backdoor was missed.
- Keep checking Search Console for new security messages and for spam URLs still indexed.
- Check email delivery. If your server sent spam, its IP address may be on email blocklists. WordPress.org flags this as an increasingly common side effect.
- Consider customer data. If the site stored customer details, such as form entries or store accounts, read the FTC’s Data Breach Response guide. In the US, state laws decide who you must notify and when. This is general information, not legal advice; ask a lawyer about your own duties.
- Fix the routine that failed. Most hacks trace back to a plugin that was not updated in time. Our guide on updating plugins safely makes weekly updates low-risk.
Frequently asked questions
Can I just restore a backup to fix a hacked WordPress site?
Sometimes, but a restore alone rarely finishes the job. The backup must predate the hack, which is hard to know because attackers often wait before acting. And the weak plugin or stolen password is still there after the restore. Restore, then update everything, change all passwords and scan the restored site.
How do hackers usually get into WordPress sites?
Most often through a plugin or theme with a known flaw that was not updated in time. Patchstack found that 91% of new WordPress vulnerabilities in 2025 were in plugins, and only 6 were in WordPress core. Stolen or weak passwords are the other common route, often taken from an infected computer.
Will a hack hurt my Google rankings?
It can. Google may show a “This site may be hacked” label or a browser warning, and spam pages can push your real pages down. Rankings usually recover once the site is clean, the spam URLs return 404 or 410, and Google has processed your review request.
Should I delete my WordPress site and start again?
Usually not. WordPress.org notes that a full wipe is often not practical. Replacing core files, reinstalling plugins and themes from official sources and cleaning the database gets the same result while keeping your content. A rebuild makes sense only when the site is old, unsupported or full of custom code nobody understands.
Will my hosting company clean a hacked site?
Some do, some only suspend the site, and some charge for it. Managed WordPress hosts more often include malware removal. Ask your host what it covers before paying anyone else, and check whether other sites on the same account were affected.
Why does my WordPress site keep getting hacked again?
Because something from the first attack is still there: a hidden backdoor file, an unknown admin account, an old password or the same vulnerable plugin. Change passwords again after cleaning, replace core and plugin files rather than only scanning them, and keep updating weekly.
Does a WPmodo Care plan cover hack cleanup?
Yes. Every WPmodo Care plan, from Essential at $49 a month, includes security monitoring and malware removal, with daily off-site backups kept for 30 days. The Priority plan adds same-day response for urgent issues. If we did not build your site, we run a health check first.
Let us watch your site so this does not happen again
Every WPmodo Care plan includes security monitoring, malware removal and daily off-site backups, from $49 a month with no contract.