DIY vs. professional malware removal: how to decide after your site is hacked

DIY vs. professional malware removal: how to decide after your site is hacked

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:

What does website malware removal actually involve?

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:

  1. Build an inventory of what’s modified: Compare your core files against clean copies from the original source, then do the same for the theme and plugins. For WordPress, core and repository plugins can be re-downloaded and diffed; custom theme code is where you’ll need to read carefully.
  2. Remove the injected code: That can be a block of obfuscated PHP at the top of index.php, an appended script in a legitimate JavaScript file, or redirect rules added to .htaccess.
  3. Hunt for backdoors: These are small scripts that let the attacker back in after you clean up — often a stray .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.
  4. Clean the database: Injections commonly land in post content and in autoloaded rows in wp_options. Check the user tables too, where an extra administrator account has often been created.
  5. Rotate secrets: Start with the database password in wp-config.php and the authentication salts. Then all administrator passwords, hosting and FTP/SFTP credentials, and any API keys stored in the site.
  6. Harden what let it in: Update the vulnerable plugin or theme, or remove it. Fix file permissions and remove unused accounts. Then check scheduled tasks — both WordPress cron events and real server crontab entries — for anything that re-downloads a payload.

When a site looks clean for a few days and then isn’t, it’s usually because step 3, 5, or 6 got skipped.

When is DIY malware removal a reasonable call?

Cleaning it yourself tends to go well when most of the following are true:

  • The infection is recent and you know roughly when it started. That gives you log entries and file timestamps to work from.
  • You have SFTP or SSH access plus database access, and you can take your own full backup before changing anything.
  • You have a backup from before the infection that you can inspect, even if you don’t plan to restore it wholesale.
  • The site is yours alone on its hosting account, so there’s no neighboring site reinfecting it.
  • There’s no payment card data, and no stored personal data you’d have to notify anyone about.
  • Nothing is blocklisted yet — no browser warning, no host suspension.
  • You can afford some downtime while you work, and a maintenance page won’t cost you orders.

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.

Where do DIY cleanups usually fail?

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.

Professional malware removal vs. DIY: what does each one cost?

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 payingDIYProfessional
Direct spendLittle to none, beyond tools you already haveEither a one-time cleanup fee or a subscription that bundles cleanup with monitoring and a firewall
Your timeHours of investigation, file comparison, and database work — more if you’re learning as you goMostly the time to submit the request and answer questions about access
Risk of a repeat cleanupCarried by you; a missed backdoor means doing it againUsually covered, if the provider commits to re-cleaning at no extra charge
Downtime and lost ordersDepends on how long the investigation takesDepends on the provider’s turnaround and queue
Blocklist and search impactYou handle review requests yourself and wait out the reviewBlocklist removal requests are commonly part of the service — confirm before buying
Side benefitYou learn your own stack in detailA 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.

A simple decision matrix

Your situationWhat we’d suggest
Ecommerce site, or any site that processes or stores card dataHire 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 accountHire, 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 itHire, or at minimum stop re-cleaning and start looking for the re-infector
Several sites on one hosting account are affectedHire; cross-site reinfection between accounts is painful to untangle by hand
No clean backup, and you’re not sure when the infection startedLean 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 backupDIY is realistic
You’re comfortable in the files but short on time, and the site earns money every dayHire; the hours are the expensive part
Site is a hobby project with no revenue and no personal dataDIY, 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.

What should you ask before you hire someone?

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:

  1. What’s in scope? Ask whether the price covers the database as well as files, every site on the hosting account or only the one domain, and how they handle a site with no clean backup.
  2. What happens if it comes back? Get the terms in writing — how long the re-clean window lasts, and whether it still applies if you don’t buy ongoing protection.
  3. Do you harden after cleaning, and do you tell me how it got in? A cleanup that doesn’t update the vulnerable component or rotate credentials is half a job. You should receive a report naming what was found and where.
  4. Do you handle blocklist removal? Submitting review requests to search engines and security vendors, and following up until the warnings clear, is often included. Confirm it.

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.

What to do after the cleanup, whichever path you took

The site being clean today is one checkpoint. A few things belong on the same day:

  • Once the cleanup is finished, change every password again. That means hosting, database, and all administrator accounts. If credentials were rotated mid-cleanup while a backdoor was still live, assume the new ones were captured.
  • Delete administrator accounts you don’t recognize, and check whether user registration or a plugin is creating them.
  • Update or remove the component that was exploited. If a plugin is abandoned by its developer, replace it.
  • Request a review where you’ve been flagged — Google Search Console for Safe Browsing warnings, and the equivalent form for any other vendor showing a warning.
  • Set up scanning and file-change monitoring so the next anomaly reaches you before a customer finds it.
  • Watch for search-visible leftovers. Spam pages and injected links can outlive the files that created them, and cleaned indexes take time to recrawl; our notes on SEO Spam Removal: Protect Search Rankings Before Blocklists Do cover what to look for.

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.


Frequently asked questions

Can I remove website malware myself with a plugin?

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.

When should I hire a malware removal service instead of doing it myself?

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.

How do I know the malware is really gone?

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.


Chat with Sucuri

You May Also Like