So it’s confirmed. A scanner flagged files, your host sent a notice, or visitors are landing on a page that isn’t yours. Now you have a decision to make before you touch anything — clean it yourself, or pay someone to do it. In this post we’ll look at what a cleanup actually involves, when doing it yourself is a reasonable call, and where DIY attempts tend to come apart.
There’s a fair bit of vendor content on this question that arrives at the same answer every time. We’d rather be straight with you: plenty of infections are well within reach of an administrator who’s comfortable with files and a database, and if yours is one of them, you can handle it.
Contents:
Malware removal means getting every piece of attacker-added code out of your site — files and database — closing the way in, and resetting anything the attacker could have taken a copy of. Deleting the one file your scanner named is just the start.
A complete cleanup usually covers:
.php file somewhere under wp-content/uploads/, a file named to blend in with real ones, or a few lines tucked into an otherwise normal theme file.wp_options. Check the user tables too, where an extra administrator account has often been created.wp-config.php and the authentication salts. Then all administrator passwords, hosting and FTP/SFTP credentials, and any API keys stored in the site.When a site looks clean for a few days and then isn’t, it’s usually because step 3, 5, or 6 got skipped.
Cleaning it yourself tends to go well when most of the following are true:
That combination describes a lot of small-business and personal sites, and a methodical owner can get through it in an afternoon. Take a full backup of the infected state first, including the database. You’ll want it if a cleanup edit breaks the site, and it’s the only record of what was actually there.
Three failure modes come up over and over.
Then there’s the backdoor you didn’t find. Backdoor code is written to be boring. It may be a single line that evaluates whatever arrives in a POST request, sitting in a file whose name looks like it belongs. Our team has written up the shapes these take in Examining Emerging Malware: Website Backdoors. The practical problem is that scanners catch known patterns, and a backdoor that’s one line of valid PHP has very little pattern to catch.
A site can get reinfected by something that keeps re-running. Some malware is built to restore itself: a dropper that rewrites cleaned files, a cron job that pulls a fresh payload, or a process watching for its own deletion. We’ve documented that behavior in PHP Re-Infectors: How To Stop PHP Malware That Keeps Coming Back and The Hidden PHP Malware that Reinfects Cleaned Files. If you clean a site and the same injection reappears within hours, stop editing files and go looking for the mechanism.
Database edits that quietly break things. Theme and plugin settings are often stored as serialized PHP — a string that encodes its own character lengths. Run a careless search-and-replace across wp_options and the stored length no longer matches the string, so the row fails to unserialize. Nothing errors loudly; your widgets or theme settings simply vanish. Work on a copy, and use tools that understand serialization rather than raw SQL replacements.
There’s also the case where the compromise is bigger than the website. Credential-stealing malware on the machine you upload from, or a reused hosting password, will put the infection straight back. Cleaning the site doesn’t address that.
The honest comparison isn’t one price against another. DIY has a low invoice and a real cost in hours and risk; professional cleanup has an invoice and shifts the risk onto someone who does this daily.
| What you’re paying | DIY | Professional |
|---|---|---|
| Direct spend | Little to none, beyond tools you already have | Either a one-time cleanup fee or a subscription that bundles cleanup with monitoring and a firewall |
| Your time | Hours of investigation, file comparison, and database work — more if you’re learning as you go | Mostly the time to submit the request and answer questions about access |
| Risk of a repeat cleanup | Carried by you; a missed backdoor means doing it again | Usually covered, if the provider commits to re-cleaning at no extra charge |
| Downtime and lost orders | Depends on how long the investigation takes | Depends on the provider’s turnaround and queue |
| Blocklist and search impact | You handle review requests yourself and wait out the review | Blocklist removal requests are commonly part of the service — confirm before buying |
| Side benefit | You learn your own stack in detail | A second opinion on how the attacker got in |
Pricing in this market comes in two shapes. One is a flat fee per cleanup. The other is an annual or monthly plan where cleanup is included alongside scanning and a web application firewall (a filter that sits in front of your site and blocks malicious requests). If you expect to need ongoing protection anyway, don’t compare the plan to zero. Compare it against the flat fee.
One cost people underestimate: the stretch after a browser warning appears. Once a site is flagged, traffic falls off until the warning clears, and clearing it requires a genuinely clean site plus a review you don’t control the timing of. That’s lost revenue.
| Your situation | What we’d suggest |
|---|---|
| Ecommerce site, or any site that processes or stores card data | Hire a professional, and treat it as an incident with compliance obligations rather than a maintenance task |
| Browser warning showing (“Deceptive site ahead”, “This site may harm your computer”) or host has suspended the account | Hire, unless you’re confident you can get it fully clean on the first pass — a failed review request costs you more waiting |
| Same infection returns after you clean it | Hire, or at minimum stop re-cleaning and start looking for the re-infector |
| Several sites on one hosting account are affected | Hire; cross-site reinfection between accounts is painful to untangle by hand |
| No clean backup, and you’re not sure when the infection started | Lean toward hiring, since you’ll be rebuilding trust in every file without a reference point |
| Single site, single recent injection, you have SFTP and database access and a pre-infection backup | DIY is realistic |
| You’re comfortable in the files but short on time, and the site earns money every day | Hire; the hours are the expensive part |
| Site is a hobby project with no revenue and no personal data | DIY, and treat it as practice |
Where your situation lands in two rows at once, go with the more cautious one. Card data and blocklisting are the two factors we’d never argue with.
Four questions separate a real cleanup service from a scan-and-delete script. We cover vendor evaluation in more depth in How to Choose a Website Security Provider, so here are the ones specific to an active infection:
Also ask what access they need, and give the narrowest access that lets them work. Create a dedicated administrator account and an SFTP user you can delete afterward.
The site being clean today is one checkpoint. A few things belong on the same day:
The decision between DIY and professional cleanup comes down to how contained the infection is and how much a mistake would cost you. A single recent injection on a site you fully control, with a backup you trust, is a job you can do. Hand it over if the malware keeps returning. Card data, multiple sites, or a live browser warning are reasons too. Either way, what keeps the site clean is what you do in the week after: patch the hole, rotate the secrets, and watch for file changes.
A scanner plugin can find and strip known malicious code, which often handles a simple, recent infection. What plugins miss is custom backdoors and whatever let the attacker in. Treat plugin cleanup as the first pass, then rotate credentials, update the vulnerable component, and watch for the injection returning.
Hire when the infection returns after cleaning, affects several sites or hosting accounts, involves payment or personal data, or your site is showing a browser warning or has been suspended by your host. Also hire when you have no known-clean backup and can’t tell which files were modified.
Run a scan after cleaning, then keep checking for a couple of weeks. Confirm no unfamiliar administrator accounts exist, no unexpected scheduled tasks remain, and no new .php files appear in upload directories. Check what search engines show for your site, since spam pages can persist after the files are removed.