A compromised WordPress site is one of the most stressful emergencies for anyone running an online business: pages redirecting elsewhere, spam content appearing out of nowhere, Google Search Console flagging malware, or simply a site that no longer opens. In these moments the temptation is to act on instinct, but the first minutes after discovering an attack determine how long it will take to get back online and how much data you risk losing. This guide explains what to do, in order, without making the damage worse.
In a nutshell
If your WordPress site has been hacked, the priority is to isolate the site, change all access credentials, identify the attack’s entry point and restore from a clean backup before putting it back online. It is not worth intervening “by trial and error”, deleting files at random: you risk breaking functionality without removing the real cause, leaving the door open for a new attack within days. If you have no in-house technical skills, the safest choice is to rely immediately on specialist support that can diagnose the cause before intervening, rather than proceeding by trial and error on a site that may be generating sales or leads every day.
How to tell if your WordPress site has really been hacked?
The most common signs are automatic redirects to external sites, advertising pop-ups that are not yours, new pages you did not create (often indexed on Google with content in other languages), browser or Google Search Console warnings about malware, or a sudden and inexplicable slowdown of the site. An abnormal increase in traffic to pages that do not exist on your site is also a clue not to be underestimated.
The technical signs to check
If you have access to your hosting panel or a security plugin, check for PHP files with suspicious names or recently modified, admin users you do not recognise in the WordPress user list, and scheduled tasks (cron) you did not set up yourself. These elements almost always confirm an ongoing compromise, not a simple malfunction.
What to do right away: the step-by-step procedure
Once you confirm the site is compromised, following the correct sequence reduces the risk of making the damage worse and speeds up recovery. Follow these steps in the order given, without skipping any:
- Put the site into maintenance mode or take it offline temporarily. Blocking public access prevents the attack from continuing to spread (for example by sending spam to other visitors) while you work on the diagnosis.
- Change all passwords immediately. WordPress login, database, FTP/SFTP, hosting and any linked accounts: if a credential has been compromised, leaving it unchanged even for just an hour gives the attacker time to get back in.
- Do not delete anything before making a copy of the current state. Even an infected site should be saved “as is” before intervening: it serves as a reference for understanding what has been modified and, if necessary, for a possible report.
- Identify the entry point. Check plugins and themes that have not been updated for a long time, nulled plugins (downloaded from unofficial sources) or outdated WordPress versions: they are the most common cause of compromise.
- Restore from a clean backup from before the infection. This is the most reliable method for actually removing malware, far safer than manually removing infected files one by one.
- Update everything before putting the site back online — WordPress core, theme and plugins — and remove any plugin or theme no longer in use: every outdated component is a potentially open door.
- Regenerate the WordPress security keys in the configuration file, to invalidate any residual sessions left by the attacker.
- Verify the site with a security scanner before reactivating it publicly, to confirm that no traces of malicious code remain.
If you are not sure you can complete these steps without risking making things worse, the safest choice is to rely on specialised technical support that intervenes with a targeted diagnosis instead of proceeding by trial and error on a compromised site.
What mistakes to avoid when your site has been hacked?
The most frequent mistake is reinstalling WordPress “on top of” the infected installation hoping it will solve the problem: it almost never works, because malware often nests in uploaded files, in the database or in custom themes that survive the reinstall. Equally risky is putting the site back online right after removing a few suspicious files, without having understood how the attacker got in: without closing the hole, the site is re-compromised within days, sometimes hours.
Why you should not pay the ransom if one is demanded
In some attacks a payment request appears to “unlock” the site or the data. Paying does not guarantee any real restoration and confirms to the attacker that the target is profitable, increasing the risk of further attempts in the future. The correct path always remains restoring from a clean backup and closing the exploited vulnerability.
How to prevent a new attack in the future?
Prevention drastically reduces the likelihood of having to deal with this situation again. The elements that really make a difference are regular updates of core, themes and plugins, a solid password policy with two-factor authentication for admin access, an application firewall (WAF) in front of the site, and frequent automatic backups also stored off the hosting server. None of these measures alone guarantees total immunity, but together they consistently reduce the real attack surface.
Studio Mate offers preventive maintenance packages for WordPress and WooCommerce sites that include regular updates, security monitoring and scheduled automatic backups, designed precisely to reduce the risk of a situation like this recurring in 2026.
How much does it cost to fix a hacked WordPress site?
The cost of a recovery intervention depends on how extensive the compromise is and how much time has passed before intervening: an attack detected immediately, with a clean backup available, typically requires a targeted intervention of a few hours; an infection that has spread over weeks, without reliable backups, involves more extensive diagnosis and cleaning work. These are nevertheless indicative figures, because the real cost depends on the specific case and the structure of the site involved.
Is a one-off intervention or a continuous maintenance contract better?
A one-off intervention solves the emergency, but does not reduce the risk of the problem recurring. A continuous maintenance contract, which includes regular updates and security monitoring, generally has a cost spread over time that is lower than having to manage several isolated emergencies over the course of a year, as well as reducing site downtime in case of problems.
Frequently asked questions
How long does it take to clean a hacked WordPress site?
It depends on the severity and extent of the compromise: an intervention with a clean backup available can take a few hours, while a widespread infection without recent backups can take a day or two of work between diagnosis, manual cleaning and thorough verification.
Should I notify Google if my site has been compromised?
Yes, if Google has flagged the site as dangerous in Search Console, after cleaning you need to request a manual security review: without this request, the “unsafe site” warning can remain visible to users even after the problem has been resolved.
Is the backup I have enough for the restore?
Not always: a backup must be verified to make sure it predates the infection and includes both files and database. A backup that is too recent may already contain the malicious code, invalidating the restore.
Can I avoid starting from scratch if I have no recent backups?
Often yes: an experienced technician can isolate and manually remove the malicious code by analysing files and database, even without a clean backup, although the intervention takes longer than a direct restore.
How do I know if my site is still at risk after the cleaning?
A check with an up-to-date security scanner, combined with verifying that all components (core, themes, plugins) are at the latest available version, is the most reliable way to confirm that the site is actually clean and protected.
