Short answer
- Don’t delete files at random. You may remove evidence or break the site.
- Back up, then change every password: WordPress, hosting, FTP and database.
- Find out how bad it is before you start cleaning.
- Look beyond the files: malware hides in the database, scheduled tasks and must-use plugins, so reinstalling WordPress isn’t enough.
How to know your WordPress site was hacked
- Visitors get redirected to other sites, sometimes only on phones or only from Google.
- A fake CAPTCHA or “verify you are human” box appears that asks visitors to press keyboard shortcuts. See our fake CAPTCHA (ClickFix) removal guide.
- Google or Chrome warns that the site is dangerous or “may be hacked”.
- New admin users, plugins you didn't install, or plugins that are missing from wp-admin but present in File Manager.
- You can't log in, or your password suddenly stops working.
- Your host emails you about malware or suspends the account.
What to do in the first hour
- Change passwords from a clean device. Start with your hosting/cPanel and email accounts, then WordPress administrators. If the hacker has your email, they can reset everything else.
- Back up the hacked site. Download the files and database before changing anything. It keeps the evidence and protects you if a cleanup step goes wrong.
- Contact your host. Ask which files their scanner flagged and when, and ask them to keep the access logs.
- Download the access logs. In cPanel this is Metrics → Raw Access. Logs are often kept for only a few days, and they show exactly how the attacker got in.
- Protect your visitors. If the site is redirecting people or showing fake pop-ups, turn on a maintenance page until it's clean.
- Scan the site. Install the free Moatline Malware Scanner and run a full scan to see every infected file, fake plugin and injected post.
Then follow our step-by-step guide to removing malware from WordPress.
Where the malware hides
Most hacked sites we look at have more than one piece of malware, spread over several places. Reinstalling WordPress and the plugins only replaces those folders, so check all of these:
- The database. Large settings in
wp_optionsthat hold hidden PHP or JavaScript, often with names that look like WordPress's own (_site_option_sync_cache,wp_…_cfg). Fake CAPTCHA pop-ups are often stored here: see fake CAPTCHA hidden in the WordPress database. - Scheduled tasks (WP-Cron). A task with a harmless-sounding name that downloads the malware again every hour.
wp-content/mu-plugins. Must-use plugins run on every page and can't be switched off from the Plugins screen.- Inside real plugins. An extra PHP file added to a genuine plugin folder, where nobody looks.
- The uploads folder. PHP files (never legitimate there), and “images” such as
gallery-thumb-1a2b3c.jpgthat are really text files of stolen logins. - Hidden administrators. Accounts that don't appear on the Users screen: see unknown admin user in WordPress.
- Fake plugins that hide themselves from wp-admin: see fake WordPress security plugins.
The free Moatline Malware Scanner checks every one of these places in one scan, including files that were added to WordPress.org plugins and must-use plugins it doesn't recognise.
How did they get in?
Finding the entry point matters: if you don't close it, the site will be hacked again. The most common causes we see:
- Stolen or weak passwords. An attacker logs in as a real admin and uploads a malicious plugin. In the access log this looks like a login followed by
update.php?action=upload-plugin. - Outdated plugins with known holes, especially file managers, page builders and form plugins.
- A plugin or theme that attackers are targeting right now. Paid plugins and themes from ThemeForest or CodeCanyon often don't show updates in WordPress, so they stay old for years. Recent examples: Elementor Pro forms (fixed in 4.2.2) and the Soledad theme (fixed in 8.7.8). Check our list of WordPress plugins and themes under attack.
- Nulled premium plugins or themes downloaded from “free” sites. They often contain a backdoor from day one.
- Leftover installer and backup files, such as old
installer.phpfiles from migration tools. - Another site on the same hosting account that was already infected.
Why hacked WordPress sites keep getting hacked again
When a site is reinfected days after a cleanup, something was left behind. Check these places:
- Hidden admin users created by the attacker.
- Fake plugins that hide themselves from the Plugins page.
- wp-content/mu-plugins, which load automatically and don't show up as normal plugins.
- PHP files in wp-content/uploads.
- Scheduled tasks in the database that download the malware again.
- Passwords and security keys that were never changed, so the attacker simply logs back in.
Updating the plugin that let them in doesn't remove anything they added. More on this in why WordPress malware keeps coming back.
Stop it happening again
- Turn on two-step login for every administrator.
- Keep WordPress, plugins and themes updated, and delete what you don't use.
- Turn off the built-in file editor and block PHP in the uploads folder.
- Use a custom login address so bots can't find your login page.
- Scan regularly, so the next infection is caught in days, not months.
Moatline's free plugin does all of these. See Lock, file editor & uploads and two-step login in the docs.
Don’t want to do this yourself? Our team cleans hacked WordPress sites every week: WordPress malware removal service, from $45, usually done within 24 hours.
Frequently asked questions
Should I delete my hacked WordPress site and start again?
Will my host fix a hacked WordPress site?
Can a hacked WordPress site harm my visitors?
How do I know if my WordPress site is still hacked?
How long can a WordPress hack go unnoticed?
I updated the plugin that let them in. Is the site clean now?
Scan your site for free
Moatline checks files, the database and page-builder content. Nothing changes unless you click a button.
More guides
- How to secure a WordPress site: the 2026 checklist
- WordPress malware keeps coming back: the file that rebuilt it from the database
- Fake WordPress security plugins: a real case from four hacked sites
- How to remove malware from WordPress
- How to scan WordPress for malware
- FBI warning: Gootloader used 1,000+ hacked WordPress sites. How to check yours