1. Contain the incident

Put the site into maintenance mode if needed, take a forensic copy before mass deletes, and change hosting panel passwords if you still have access. Note what visitors see: redirects, spam pages, injected scripts, or a defaced homepage.

Write down when you first noticed the problem, what changed recently (a new plugin, a theme edit, a hosting move) and which time zone your notes use. The WordPress.org guidance on hacked sites calls this documentation step the start of an incident report, and it is worth the five minutes: your host, a security vendor or a developer will ask for exactly this information.

Illustration of a compromised WordPress site contained inside a protective barrier before cleanup begins
Contain first: a snapshot and a clear record of symptoms make every later step safer.

2. Identify the entry path

Common paths include abandoned plugins, weak admin passwords, nulled themes, outdated PHP, and exposed file managers. Knowing the door matters more than deleting one suspicious file.

Hosting access logs are often the fastest clue. Look for unusual POST requests to plugin files, logins from unfamiliar locations, or uploads that happened just before the first symptom. If one plugin appears in a current security advisory, such as those in my October 2026 plugin vulnerabilities round-up, treat it as the prime suspect until you can rule it out.

Diagram of common WordPress hack entry paths such as outdated plugins, weak passwords and nulled themes, alongside what to check for each
Common entry paths on the left, the evidence that confirms or rules them out on the right.

3. Clean malware and restore trust

Remove injected code from themes, mu-plugins, uploads disguised as PHP, and database spam posts. Prefer restoring known-good core/theme/plugin files from official sources over editing malware by hand when the infection is wide.

If you have WP-CLI access, wp core verify-checksums compares core files with the official WordPress.org checksums, and wp plugin verify-checksums --all does the same for plugins hosted on WordPress.org. Premium plugins are not covered, so download fresh copies from the vendor's account area rather than trusting the files already on the server.

Do not edit your way out of a wide infection. Hand-editing dozens of files usually leaves one backdoor behind. Replacing core, themes and plugins with clean packages, then reviewing only uploads, mu-plugins and the database by hand, is quicker and far more reliable.
Illustration of infected website building blocks being replaced with clean ones during WordPress malware removal
Replace rather than repair: clean packages from official sources restore trust faster than line-by-line edits.

4. Rotate credentials and harden

Assume passwords were stolen. Rotate WordPress, hosting, FTP/SFTP, database, and email credentials. Enable MFA, limit login attempts, and remove unused plugins.

What should hardening include after a hack?

Hardening is about closing the door you found in step 2 and the obvious neighbouring ones. It does not need a dozen overlapping security plugins. Start with the basics that remove whole classes of attack:

The official WordPress hardening guide is clear that disabling the file editor will not stop every upload, but it removes an easy path. Combine it with off-site backups so the next incident, if there is one, starts from a clean restore point. My post-hack hardening notes go into each item in more depth.

Checklist of credentials to rotate after a WordPress hack, including admin, hosting, SFTP, database, email, salts and API keys
Rotate everything that could have been exposed, then switch on multi-factor authentication.

5. Verify and monitor

Check the homepage, login, forms, Search Console security issues, and Google Safe Browsing status. Keep monitoring for a week-reinfection usually shows up quickly if the door is still open.

If Google flagged the site, the Security issues report in Search Console lists the problems it found. Fix every issue, make sure the entry path is closed, and only then request a review; asking too early tends to slow things down rather than speed them up.

Four-step flow for verifying a cleaned WordPress site: test key journeys, check Search Console and Safe Browsing, request a review, monitor for seven days
Verification is a week-long habit, not a single check on the homepage.

Should you restore a backup or clean the site in place?

If you have a backup taken before the infection started and the site has not changed much since, restoring it is often the fastest route. The catch is timing: many infections sit quietly for days or weeks before symptoms appear, so a recent backup can contain the same backdoor. Compare file dates and the first suspicious log entries before you choose a restore point, and follow restoring WordPress from a backup for the order of work.

Cleaning in place makes sense when you have no clean backup, when there are orders, bookings or posts since the last good backup that you cannot afford to lose, or when the infection is limited to a few known files. Either way, steps 2, 4 and 5 still apply. A restore without closing the entry path is just a pause before the next compromise.

When should you bring in professional help?

Some situations are worth handing over early rather than late:

If personal data may have been accessed, you may also have legal reporting duties in your country, so involve whoever is responsible for data protection in your organisation. For hidden accounts specifically, my guide to finding hidden admin users in WordPress walks through the checks.

Frequently Asked Questions

How long does it take to clean a hacked WordPress site?

A small site with a clear entry path and good backups can often be cleaned in a few hours. Wider infections, missing backups or repeated reinfection take longer, because the investigation, not the deletion, is the slow part.

Will a security plugin remove the malware for me?

A scanner can find many known infections and is useful for monitoring, but it cannot always tell you how the attacker got in or find every backdoor. Use it alongside clean reinstalls, checksum checks and a review of users, cron jobs and uploads.

Do I need to tell Google my site was hacked?

If Search Console shows a security issue or visitors see a Safe Browsing warning, request a review once the site is clean and the entry path is closed. If Google has not flagged anything, there is nothing to request, but keep watching the Security issues report.

Should I delete my WordPress site and start again?

Usually not. Replacing core, theme and plugin files with clean copies and cleaning the database achieves the same result while keeping your content and URLs. A full rebuild is only worth considering when the site is very old and unmaintained anyway.

How do I stop it happening again?

Keep plugins, themes, WordPress and PHP updated, remove anything you do not use, use unique passwords with multi-factor authentication, and keep tested off-site backups. A regular maintenance routine prevents most repeat incidents.

Final Thoughts

Cleaning a hacked WordPress site is mostly about order and patience: contain, find the door, replace what you cannot trust, rotate every secret, and then watch closely for a week. Skipping straight to deleting suspicious files feels productive but is the most common reason infections return. Work calmly through the steps, document what you find, and you will end up with a site that is cleaner and better protected than it was before the attack.

Need help applying this?

If you need hands-on cleanup, I offer WordPress hacked-site recovery and ongoing maintenance.

Related service: Site hacked recovery · Contact · All articles

Official References

Sources checked on 29 October 2026: