The message usually arrives the same way. A client sees a browser warning. A contact form starts sending spam. Search traffic falls off and someone notices a redirect that only appears on mobile or when coming from Google.
If you're dealing with that right now, slow down and work the problem in order. Good wp malware removal isn't guesswork. It's containment, evidence preservation, file replacement, database cleanup, and then hardening so the same door can't be used again.
For Elementor sites, agencies, and freelancers on shared hosting, the hard part isn't just finding the obvious infection. It's catching the malware hiding outside the standard WordPress path, in uploads folders, account-level files, or leftover scripts that automated plugins don't fully explain.
Your Site Is Hacked Now What
That first reaction is usually panic, followed by the urge to start deleting files. Don't. Treat the site like a contaminated system, not a broken page.

Start with this mindset: you are not just removing visible malware, you're removing persistence. That's why basic plugin scans often leave agencies stuck in a reinfection loop. One of the biggest gaps in WordPress cleanup is malware living outside the installation itself. Patchstack notes that 91% of unique hacks contain obfuscated code at the top or bottom of files, which is why server-level inspection matters just as much as dashboard-based scanning in Patchstack's WordPress malware removal guide.
If you're supporting clients who also use infected local machines to access hosting or WordPress admin, fix that side too. A practical example is this guide to computer virus removal in Sheffield, which is useful when you suspect a compromised laptop may be feeding stolen credentials back into the site.
What to do in the next few minutes
- Stop making live edits. Every rushed deletion increases the chance you'll remove a legitimate file and break recovery.
- Confirm symptoms. Redirects, defaced pages, spam injections, unknown admin users, or malicious scripts in uploads all point to different cleanup priorities.
- Assume the infection is wider than the dashboard shows. Especially on shared hosting and multi-site agency setups.
- Prepare for a manual pass. If you're running Elementor with several add-ons, custom snippets, and client-installed plugins, a plugin-only cleanup usually won't be enough.
Cleanups fail when people remove what they can see and ignore how the attacker got back in.
This guide is built for the situation you're likely in now. No fluff. No fantasy "one-click fix." Just the order of operations that gets a compromised WordPress site under control without making the damage worse.
Emergency Triage and Site Lockdown
Before you clean anything, contain it. In 2025, the WordPress ecosystem saw 11,334 new vulnerabilities, a 42% year-over-year increase, and malicious file uploads nearly tripled in Q4 according to Patchstack's State of WordPress Security in 2026. That's why immediate lockdown matters in modern wp malware removal. If you leave the site open while you investigate, the attacker may still have write access.

Lock it down first
Take these actions in order:
- Put the site behind a maintenance page. You want to reduce visitor exposure and stop search engines or customers from hitting infected pages while you're working.
- Create a full backup of the infected state. That means files and database. Keep it labeled as compromised.
- Change credentials from a clean device. Start with hosting, SFTP or SSH, WordPress admin, and database-related access.
- Open a ticket with the host. Ask whether they see malware outside your document root, suspicious cron activity, or neighboring account issues on shared hosting.
A backup isn't just insurance. It preserves evidence. If you later discover the site was reinfected through a rogue file outside /public_html or through a modified config file, you'll want the original state to compare against.
If you don't have a recent backup process, fix that immediately going forward. This walkthrough on how to backup a WordPress site is worth bookmarking before the next incident.
What not to do
A lot of cleanup damage happens in the first hour.
- Don't reinstall random plugins in panic
- Don't replace
wp-contentwholesale - Don't trust the host's "malware removed" message without verification
- Don't work from an infected laptop
Here's a quick visual walkthrough if you need a reset before touching files:
Triage priorities by risk
| Priority | Action | Why it matters |
|---|---|---|
| Highest | Take site offline gracefully | Protects users and reduces further malicious activity |
| High | Full file and database backup | Preserves evidence and gives you a rollback point |
| High | Rotate credentials | Cuts off simple re-entry through stolen passwords |
| High | Notify hosting provider | Helps identify account-level or server-side contamination |
| Medium | Log symptoms and timestamps | Makes forensic comparison faster during cleanup |
Practical rule: Don't start deleting until you've preserved the scene and blocked easy access back in.
Scanning and Pinpointing the Infection
Once the site is contained, switch from emergency mode to detective mode. This stage is where many people either over-trust scanners or waste time reading every PHP file manually. You need both approaches, in the right order.
Leading tools like MalCare have shown a 91% detection rate, but the broader threat environment includes 500,000 malicious files detected daily, according to the referenced security discussion at this YouTube source. That scale is exactly why wp malware removal can't rely on automation alone. A scanner gives you leads. Manual review finds what the scanner doesn't understand.
Start with automated scanning
Run one or more known WordPress-focused scanners. Wordfence, MalCare, and GOTMLS all have value here, but use them as triage tools, not as final authority.
Automated scanning is good at:
- Flagging altered core files
- Finding known signatures
- Spotting suspicious admin users or plugin changes
- Surfacing malware in common plugin and theme paths
Automated scanning is weak at:
- Catching obfuscated payloads hidden in strange account folders
- Explaining whether a file is malicious or just ugly legacy code
- Finding server-level persistence outside the WordPress directory
- Cleaning complex Elementor stacks without breaking custom work
If you want a broader prevention workflow after cleanup, this guide on scanning WordPress for vulnerabilities is useful because it shifts your process from reaction to regular inspection.
Then inspect the filesystem manually
Now check what changed recently. In practice, I care less about the scanner's confidence score and more about unexpected file location plus suspicious code pattern plus recent modification time.
Look closely at:
wp-content/uploadsfor PHP files, odd subfolders, and fake media names- must-use plugins and custom plugin directories
- inactive themes and plugins
- account-level temp folders and adjacent web roots
- Elementor custom code areas, HTML widgets, and snippet managers
For agencies, one hacked site often turns into several. Shared accounts let an attacker plant scripts outside one install and reuse them across others.
Use server-side search where possible. These are simple first-pass checks:
grep -R "eval(" /path/to/site --include=*.php
grep -R "base64_decode" /path/to/site --include=*.php
grep -R "gzinflate" /path/to/site --include=*.php
grep -R "<iframe" /path/to/site --include=*.php --include=*.js
These commands don't prove a file is malicious. They narrow the search. You'll still need to compare flagged files against known clean originals.
A scanner can tell you where smoke is coming from. It can't always tell you which walls are burning.
Check Elementor-specific hiding spots
Elementor sites create extra places for injected code to blend in with legitimate customization:
- Custom HTML widgets that contain external script tags
- Theme builder templates with unfamiliar inline JavaScript
- Third-party Elementor addon folders with modified PHP files
- Custom code snippet plugins storing injected tracking or redirect code
- Popup templates used as stealth payload delivery points
If your local machine might also be compromised, basic computer virus cleanup tips can help you rule out the workstation as the source of repeated credential theft. That's especially relevant when a cleaned site gets hit again after the same admin logs back in.
The Deep Clean Manual File and Database Sanitization
This is the part that clears the infection. It also breaks sites when people improvise. Be methodical.
The safest manual approach is not random deletion. It's controlled replacement of known-good core files, followed by targeted review of wp-content, then database sanitization, and finally config hardening. That cleanup pattern is reflected in the practical process described in this WordPress malware removal walkthrough.

Replace core files instead of chasing every edit
Delete the WordPress core directories and replace them with fresh copies from WordPress.org.
Remove and replace:
wp-adminwp-includes
Also replace root core files with clean versions from a fresh download, while preserving your actual site-specific configuration and content.
Why this works:
- Core files should match official releases.
- Attackers love hiding in core because site owners are reluctant to touch it.
- Fresh replacement is faster and safer than hand-editing compromised core PHP.
Do not delete wp-content as a shortcut. That's where your themes, plugins, uploads, and often your business-critical assets live.
Audit wp-content like a forensic cleanup
At this stage, most real work happens.
Break it into three passes.
Themes and plugins
Re-download every active plugin and theme from official sources. Replace their directories one by one where possible. For commercial products, use the vendor's clean package, not a copy you found in an old local archive.
Review these especially closely:
- Page builder add-ons
- Abandoned plugins
- Inactive themes
- Any plugin with custom edits done directly in production
If a plugin folder contains files you don't expect, compare it with the vendor package using a diff tool such as Beyond Compare.
Uploads and odd executable files
Your uploads directory should mostly contain media. It should not be home to executable PHP payloads, fake cache loaders, or oddly named scripts tucked inside year and month folders.
Look for:
- PHP files in uploads
- JS files with unreadable variable names and encoded blobs
- Recently modified files that don't match your publishing activity
- Nested directories with names designed to look harmless
If a file in uploads executes code, treat it as suspicious until you prove otherwise.
Account-level files outside WordPress
This is the step many guides skip. Check parent directories, alternate web roots, temp folders, and account-level config files. If you only clean inside WordPress, the reinfection script outside it may write the malware back.
For shared hosting agencies, inspect sibling installs too. One dirty site can keep reseeding the rest.
Sanitize the database carefully
Malware often survives in the database even after the files look clean. Redirects, spam injections, and script payloads can sit in post content, comments, revisions, widgets, or autoloaded options.
Search for patterns such as:
<iframebase_64_decodeeval()- unexpected external script references
- hidden admin usernames or suspicious option values
Example queries for investigation:
SELECT ID, post_title FROM wp_posts
WHERE post_content LIKE '%<iframe%'
OR post_content LIKE '%base_64_decode%'
OR post_content LIKE '%eval(%';
SELECT comment_ID, comment_author FROM wp_comments
WHERE comment_content LIKE '%<iframe%'
OR comment_content LIKE '%base_64_decode%'
OR comment_content LIKE '%eval(%';
SELECT option_name FROM wp_options
WHERE option_value LIKE '%<iframe%'
OR option_value LIKE '%base_64_decode%'
OR option_value LIKE '%eval(%';
Review every match before deletion. On Elementor sites, some legitimate content includes script-heavy embeds, so context matters.
Check the files attackers love most
There are a few files and settings I never skip:
.htaccessfor rogue redirects and strange rewrite ruleswp-config.phpfor injected includes or suspicious codeindex.phpin the web root and in theme folders- cron-related persistence mechanisms
- user tables for unknown admins
After cleanup, make wp-config.php unwriteable if your environment allows it and your deployment process won't break.
Final verification pass
Before bringing the site back:
- Run a fresh malware scan
- Open the site in multiple browsers and device types
- Check random posts, templates, and forms
- Review source code for unfamiliar scripts
- Confirm plugins and themes are current and clean
- Inspect logs if your host provides them
A successful wp malware removal job isn't "the homepage loads." It's "the payload is gone, the entry point is closed, and the persistence mechanism is removed."
Hardening Your Site to Prevent Reinfection
You finish the cleanup, the homepage loads, and the client relaxes. Then the spam redirects come back three days later because the actual entry point was never closed. That second hit is common after rushed cleanups, especially on budget agency jobs where nobody checks beyond the WordPress dashboard.
A clean file set is only part of recovery. You also need to harden the install, the hosting account around it, and any writable path an attacker can reuse. Security plugins help, but they often miss malware that lives outside the WordPress installation, such as dropped files in adjacent directories, poisoned cron jobs, or backdoors in old staging copies. On Elementor builds, that matters even more because the site often includes more plugins, more templates, and more places for an attacker to hide persistence without breaking the front end.
Close the hole that let them in
Start with the likely access path and fix that first.
| Likely weakness | What to do |
|---|---|
| Outdated plugin or theme | Update it, replace it, or remove it entirely |
| Weak or reused credentials | Reset passwords, review password reuse, and enable 2FA |
| Shared hosting cross-contamination | Inspect sibling installs, isolate accounts, and clean old copies |
| Writable sensitive files | Tighten permissions and review who or what needs write access |
| Unused extensions or stale staging sites | Delete them fully, including leftover directories and databases |
This is the part many teams skip. They patch the visible infection but leave the abandoned plugin, the exposed file manager, or the forgotten subdomain in place. If you support multiple client sites on one hosting account, check outside /public_html too.
Hardening steps that actually reduce repeat infections
Use this checklist after the site is clean and stable:
- Update WordPress core, plugins, themes, and builder add-ons
- Delete anything unused, especially deactivated plugins and old themes
- Reset passwords for every user account, not just the main admin
- Rotate WordPress salts so existing sessions are invalidated
- Review admin users and service accounts for anything unfamiliar
- Set file permissions conservatively and limit write access to what your workflow needs
- Protect
wp-config.phpif your host and deployment setup allow it - Enable two-factor authentication for admins and editors with high-level access
- Add a WAF or host-level firewall with WordPress-specific rules
- Turn on file change monitoring and login alerts
Trade-offs matter here. Locking down file writes can block plugin edits from the dashboard, auto-updates, or parts of your deployment flow. That is usually a good trade if you manage sites professionally, but test it before applying the same rule everywhere.
Look beyond WordPress itself
Reinfection often starts from something a plugin scanner never inspected.
Check for old backups left in web-accessible folders, forgotten staging domains, extra FTP users, malicious cron entries, writable upload directories with executable files, and neighboring sites on the same account. If one compromised account can write into another site's path, hardening inside WordPress is not enough. You need hosting-level isolation or a clean migration.
For a broader baseline, this walkthrough on how to secure a WordPress site is a useful reference for standard controls. Pair that with a repeatable operations process. This guide to WordPress site maintenance is helpful for teams that need updates, backups, monitoring, and access reviews to happen on schedule instead of only after a breach.
Process beats plugin count
Agencies that keep sites clean usually follow a simple pattern. They run fewer plugins, remove abandoned tools quickly, review access after staff changes, test backups before they need them, and keep staging environments from turning into forgotten attack surfaces.
That work is less exciting than installing another security plugin. It prevents more reinfections.
When to Call a Pro A Decision Checklist
DIY cleanup makes sense sometimes. It doesn't make sense every time.
If you're comfortable with SSH, file diffs, database inspection, and evaluating suspicious code without deleting legitimate functionality, you can handle a lot in-house. If not, pushing through anyway can stretch downtime and create a second problem on top of the first.
Ask yourself these questions
- Can you safely compare clean and infected files? If not, you'll struggle to distinguish malware from custom development.
- Can you inspect the database without guessing? Elementor-heavy sites often store large volumes of structured content. Blind edits can damage layouts.
- Do you have reliable backups? If your last known good backup is uncertain, recovery gets slower and riskier.
- Is this on shared hosting with multiple client sites? If yes, the cleanup scope is wider than one install.
- What's the cost of another day offline? A paid cleanup may be cheaper than prolonged downtime and client churn.
DIY versus professional help
| Path | Best when | Main trade-off |
|---|---|---|
| DIY cleanup | You know WordPress internals and can work calmly under pressure | Costs more of your time and carries more execution risk |
| Professional cleanup | The site is business-critical or the infection scope is unclear | Costs money, but usually shortens investigation and recovery |
| Restore from clean backup plus hardening | You have a verified clean restore point | You still need to find and close the original entry path |
There's no shame in escalating. A professional service can be the right call when the site processes revenue, handles customer data, or sits inside a fragile multi-site hosting environment.
One simple rule helps: if you're no longer confident about what is clean and what is compromised, stop editing production and escalate.
If you're building or maintaining Elementor sites regularly, Exclusive Addons is worth reviewing as part of a cleaner, more controlled site stack. Fewer questionable add-ons, better component discipline, and a more deliberate plugin footprint make long-term maintenance and security much easier.