You shouldn't. We cut the injected code out of the files instead of deleting whole files, and we replace the CMS core files with the original versions from the vendor. Before we start, we always make a copy of the initial state, so there is something to go back to.
Site infected, blocked or down
Malware removal and website repair
Google is warning people about your site, the site is sending visitors somewhere else, or spam is going out from your account. Before you start deleting files, read what to do in the first hour and how the repair works.
cpGuard included in the plan price
Hydrogen mezoSFERA
Lowest price in the last 30 days: PLN 60 excl. VAT / year
- Storage 10 GB (NVMe)
- Transfer unlimited
- Domains unlimited
- vCPU up to 2 x 3.5 GHz
- RAM 2 GB RAM
Renewal price: PLN 60 excl. VAT / year
Who this offer is for
- Site flagged as dangerous by Google
- Visitors redirected to unknown sites
- Spam sent from the hosting account
- Homepage replaced by an attacker
- Sudden rise in resource usage for no reason
- White screen or an error after an update
You rarely find out about an infection on your own. Usually a customer calls to say your site is redirecting them to some unknown store. Or Google shows “This site may be harmful” in the search results. Or the browser displays a red warning screen, email starts bouncing, and your hosting provider sends a message about exceeded resource limits. The first reaction is always the same: do something, fast.
And that is exactly when it’s easiest to make things worse. Below we describe what to do in the first hour, what the repair looks like on our side, and what exactly cpGuard does. It is the protection system running on our servers, and it ends most of these stories before they begin.
The first hour: don’t delete anything
The instinct is understandable: delete the suspicious file, reinstall WordPress, restore yesterday’s backup. Each of these three things can do harm.
- Deleting a file destroys the evidence and almost never removes the backdoor. A break-in usually means several files in different places plus one inconspicuous addition in the database or in the cron jobs.
- Reinstalling the CMS doesn’t touch the plugins, the theme or the uploads directory, and that is where the problem most often sits.
- Restoring yesterday’s backup is rarely enough. Infections are usually detected after weeks, so “yesterday’s” backup is often already infected. That’s why we keep backups for up to 30 days, so there is something to choose from.
What’s worth doing right away: make a full copy of the files and the database, even an infected one. It is material for analysis. Change the passwords to the control panel, FTP and the database, but do it from a clean device. And write to us before you start deleting.
How the repair works
We always work in the same order, because skipping steps ends with the infection coming back two weeks later.
- Isolation and backup. We take the site out of traffic or set up a separate copy of it, so we can clean it calmly and without new intrusions while we work.
- Scan. A full scan of the files and the database plus a list of recently changed files. That list usually shows right away when and how someone got in.
- Cleaning. We cut the injected code out of the files instead of deleting whole files. We replace the core files of the CMS, plugins and theme with the original versions from the vendor’s packages.
- Closing the entry points. Database and account passwords, new security keys in the WordPress configuration, a review of administrator accounts (after a break-in there is often one “extra” account), cron jobs, PHP files in the uploads directory, rules in .htaccess.
- Removing the cause. Updating the CMS, plugins and theme, throwing out abandoned extensions, moving to a supported PHP version. Without this step, cleaning only postpones the problem.
- Getting off the warning lists. Submitting the site for review in Google Search Console so that the dangerous site message disappears.
- Monitoring. For a few days after cleaning we watch the firewall and scanner logs. The real test is not that the site works, but that the infection doesn’t come back.
Where it came from: four typical routes
In practice, almost everything fits into four scenarios:
- An outdated plugin or theme. The most common route. A vulnerability gets published and bots scan the entire internet for it within hours. Nobody picks your site on purpose. It simply happens to have that plugin.
- A password. A dictionary attack on the login panel, or a password that leaked from a completely different service and was reused.
- A forgotten installation. An old WordPress in the /test directory, a copy of the store in /old, three years old, with no updates. To an attacker, that is an open door next to the locked ones.
- The site author’s computer. FTP credentials stolen from an infected laptop. In that case the site “breaks on its own” after every cleanup until you clean up the computer.
How cpGuard works
cpGuard is a protection system installed at the server level and integrated with the DirectAdmin panel. It is not a CMS plugin and it doesn’t use your account’s resources for scanning. It works in three layers that are worth understanding separately, because they respond to different kinds of attack.
Layer 1: web application firewall (WAF)
This is ModSecurity with the commercial Malware.Expert rule set, tuned for shared servers. It filters requests before they reach your PHP, and that is the most important part. Among other things, it blocks:
- SQL injection and attempts to steal the contents of the database,
- XSS attacks (injecting scripts into the page content),
- local and remote file inclusion (LFI/RFI),
- abuse of file upload forms,
- running web shells, that is, remote access panels planted after a break-in,
- attacks on freshly published vulnerabilities, before a patch is available.
The set also includes rules written specifically for WordPress, Joomla and Drupal. The practical takeaway: the firewall buys you time to update a plugin you haven’t gotten around to updating yet. It doesn’t excuse you from updating, but the difference between “a vulnerability exists” and “a vulnerability has been exploited” usually comes down to this layer.
Layer 2: file scanner
The scanner watches file changes in real time and additionally goes through the account on a schedule. When it finds something suspicious, the file goes to a cloud engine for analysis and a cleaned version comes back to the server: the injected fragment is cut out, the file stays in place and the site keeps working. That is an important difference from ordinary antivirus tools, which delete the whole file and break the site in the process.
Files that can’t be cleaned go to quarantine. They can be restored from it, and this is not just a technical detail: scanners sometimes mistake custom, unusual code for malicious code. Quarantine means that a false positive can be reversed with one click instead of costing you the file.
Layer 3: logins, bots and IP reputation
This covers everything that happens before the actual attack on the code:
- protection against dictionary attacks on WordPress and Joomla login panels: instead of letting thousands of password attempts through, the server cuts them off on its side;
- a captcha for bots, which filters out automated traffic without blocking people;
- a firewall based on a database of addresses with a bad reputation (IPDB), updated continuously, so requests from addresses known for abuse never reach the site;
- detection of rootkits and suspicious symbolic links, the trick an attacker uses to try to get from one account to another on a shared server.
What you see of this on your end: in the DirectAdmin panel you can view the attacks blocked on your domains. You don’t have to take our word for it or write to ask whether anything is going on.
What cpGuard won’t do
We prefer to say this plainly, because overpromising on security ends in disappointment at the worst possible moment.
- It won’t update your plugins for you. It is still your site and your decisions about what runs on it.
- It won’t fix a bug in the code of your custom theme or a hole in a plugin written to order.
- It won’t replace backups. The best protection is the kind that still leaves you with something to restore the site from.
- It won’t undo a password leak. If someone has your panel credentials, they walk in through the door, not through a vulnerability.
- False positives happen. A firewall rule can sometimes block a perfectly legitimate action, for example an editor in the CMS or a plugin that uploads large files. In that case we adjust the rules for the specific domain. All it takes is a ticket.
Hygiene after the repair: fifteen minutes a month
Once the site is clean, the hardest part remains: not letting it happen again. The list is short and it really is enough:
- updates once a month, with one person responsible for the task;
- removing unused plugins and old installations from subdirectories;
- unique passwords and two-step verification when logging in to the CMS panel;
- only as many accounts with administrator privileges as you really need;
- checking that the backup actually restores, because a backup that has never been tested is only an assumption;
- a PHP version that still receives security fixes.
The rest of the server-side protection parameters (response times, monitoring scope and incident procedures) are described on the security parameters page.
How to get started
Tell us what happened and give us the site’s address. If you have a message from Google Search Console, a report from a security plugin or an email from your current hosting provider, send it along, because it usually narrows the search right away. We’ll tell you whether it’s an hour’s repair or half a day’s, and whether the site can be saved without restoring from a backup.
You don’t have to move your hosting to talk to us about it. And if you stay with your current provider, we’ll tell you plainly what is missing there. If you do move your site to us, migration is free, cpGuard works from day one with no configuration, and we check the site as part of the move. Running a store or a site on WordPress? Take a look at WordPress hosting and WooCommerce hosting too, where we break down the requirements of these two cases.
What you get for the price
- cpGuard included in the price of every mezoSFERA plan
- ModSecurity web application firewall with Malware.Expert rules
- Real-time and scheduled file scanner
- Quarantine with the option to restore a file
- Protection against dictionary attacks on the CMS panel
- Firewall based on a database of addresses with a bad reputation
- View of blocked attacks in the DirectAdmin panel
- Backups for up to 30 days
- PHP 5.6 to 8.5, switchable in the control panel
- Free migration and a site check during the move
What cpGuard has actually stopped on our servers
Numbers pulled straight from the agent on the server, not from marketing materials.
33 853
Blocked requests (WAF)
last 30 days
26 254
Blocked dictionary attacks
last 30 days
38
File scanner detections
last 30 days
7 263
Files in quarantine
current state, average per server
0
Threats detected in CMSs
current state, average per server
22 684 243
Requests from addresses with a bad reputation
total, IPDB database
Source: cpGuard agent. 1 of 1 protected servers responded. Data as of 13 October 2026, 08:17.
Questions and answers
A typical infected WordPress site takes from an hour to a few hours. It takes longer when the infection is old and sits in the database, when there are a dozen or more sites on the account, or when the source is the site author's computer. In that last case, cleaning the site without cleaning up the computer makes no sense.
No. You can write to us, describe the situation and get a diagnosis. If you stay with your current provider, we'll tell you plainly what is missing there. If you move, migration is free and we check the site along the way.
After cleaning, we submit the site for review in Google Search Console. Removing the warning is then up to Google and usually takes from a few hours to a few days. We have no influence over it and we don't promise a specific time frame.
No, and nobody can honestly guarantee that. cpGuard blocks attacks on common vulnerabilities before they reach your code, catches tampered files and cuts off attacks on login pages. But if a plugin stays outdated for a year or a password leaks, no server-side layer will make up for it.
No. It runs at the server level, not as a plugin in the CMS, so scanning doesn't eat into your account's CPU and memory limits, unlike security plugins that scan files from inside WordPress.
False positives like that do happen, especially with custom code. The file goes to quarantine, from which it can be restored, and we adjust the firewall rules for the specific domain. All it takes is a ticket.
Hydrogen — mezoSFERA
Describe what happened and give us the site's address. We'll tell you whether it can be saved without restoring from a backup.