Malware removal: when DIY website cleanup is too risky
Malware removal is sometimes a realistic job for a website owner, but a full cleanup involves much more than deleting the file a scanner identifies. Sucuri’s guidance, published on November 11, 2026, says the decision depends on how contained the infection is, what access and backups are available, and how costly a mistake would be.
A complete cleanup must remove attacker-added code from both the website’s files and its database, close the route used to get in, and reset anything that may have been stolen. The process starts with an inventory of changed files. WordPress core files and plugins from the official repository can be downloaded again and compared with clean copies, while custom themes require more careful inspection. Malicious changes may include hidden PHP code in index.php, a script appended to a legitimate JavaScript file, or redirect rules placed in .htaccess.
The next task is finding backdoors. A backdoor is a hidden way for an attacker to regain access after the visible malware has been removed. It may be a PHP file under wp-content/uploads, a file with a name designed to look legitimate, or a few lines inserted into an otherwise normal theme file. Sucuri notes that scanners often recognise known patterns, while a backdoor consisting of a single valid PHP line may be difficult to detect.
The database also needs review. Malicious content can be inserted into posts or into autoloaded entries in WordPress’s wp_options table. Administrators should check user records for accounts they did not create. Passwords and other secrets must then be changed, starting with the database password in wp-config.php and the WordPress authentication salts, followed by administrator passwords, hosting and FTP or SFTP credentials, and application programming interface keys stored in the site.
Finally, the original entry point needs to be closed. That may mean updating or removing a vulnerable plugin or theme, correcting file permissions, deleting unused accounts and checking scheduled tasks. These include WordPress cron events and server crontab entries that may download the malware again. Sucuri says sites that appear clean for a few days and then become infected again often had their backdoor, credentials or hardening work overlooked.
DIY malware removal is most reasonable when the infection is recent and its approximate start time is known, the owner has SFTP or SSH access and database access, and a complete backup can be taken before changes are made. A pre-infection backup that can be inspected is valuable even if it is not restored wholesale. DIY is also more suitable when the site is the only one on its hosting account, no payment card or notifiable personal data is involved, no browser warning or host suspension has occurred, and the owner can tolerate downtime. A small personal or business site meeting those conditions may be manageable in an afternoon by someone comfortable working with files and databases.
A full backup of the infected state should be taken first, including the database. It provides a way back if an edit breaks the site and preserves a record of what was present. Three recurring problems make DIY work fail. One is an overlooked backdoor. Another is a reinfector, such as a dropper that rewrites cleaned files, a scheduled task that downloads a new payload, or a process that watches for its own deletion. If the same injection returns within hours, Sucuri advises stopping file edits and searching for the mechanism that restores it. Its related writeups describe PHP reinfectors and hidden PHP malware that brings cleaned files back.
A third problem is careless database editing. WordPress settings are often stored as serialized PHP, meaning the stored text includes character lengths used when the data is read. A raw search and replace in wp_options can make those lengths incorrect, causing settings to fail without an obvious error. Widgets or theme settings may simply disappear. Work on a copy and use tools that understand serialized data instead of making broad raw SQL replacements. A compromise may also extend beyond the website: malware on the computer used for uploads or a reused hosting password can immediately put the infection back.
The financial choice is not simply a zero cost versus a service fee. DIY usually means little direct spending, but it consumes time for investigation, file comparison and database work, with more hours if the owner is learning. Professional removal carries an invoice, usually either a one time fee or a subscription that may combine cleanup with monitoring and a web application firewall, a filter placed in front of a site to block malicious requests. It also shifts much of the repeat cleanup risk to the provider, if the provider promises re-cleaning without an extra charge. Turnaround, lost orders and the handling of search engine blocklist reviews depend on the provider and should be confirmed before purchase.
A browser warning can create a longer cost. Once a site is flagged, traffic may fall until the warning is cleared. That normally requires a genuinely clean site and a review whose timing the owner does not control. A simple decision matrix therefore points toward professional help for ecommerce sites or any site processing or storing card data, sites showing warnings such as “Deceptive site ahead” or “This site may harm your computer,” suspended hosting accounts, infections returning after cleanup, several affected sites on one account, or an infection with no known clean backup. A single recent injection, one site, SFTP and database access, and a usable pre-infection backup make DIY realistic. A hobby site with no revenue or personal data is the lowest risk case. When several conditions apply, the more cautious choice is appropriate, especially where card data or blocklisting is involved.
Before hiring a provider, ask whether the price includes the database, every site on the hosting account or only one domain, and cases where no clean backup exists. Get the re-cleaning period and its conditions in writing, including whether it applies without an ongoing protection plan. Ask whether the service updates or removes the vulnerable component, rotates credentials, explains how the attacker entered and provides a report of what was found. Confirm whether review requests to search engines and security vendors are included. Give the narrowest access possible by creating a temporary administrator account and SFTP user that can be deleted afterward.
After cleanup, change hosting, database and administrator passwords again. If credentials were changed while a backdoor was still active, the replacement credentials may have been captured. Remove unfamiliar administrator accounts and check whether user registration or a plugin is creating them. Update or replace the exploited component, particularly if its developer has abandoned it.