How to recover a site hit by ransomware
Isolate the site, restore from a backup taken before the compromise, rotate every credential, and fix the entry point before you bring it back online.
If your site is showing a ransom note, refusing to load, or serving files that look encrypted, replaced, or scrambled, the instinct is to start fixing things immediately. Slow down for the next few minutes. What you do, and the order you do it in, matters more to how this ends than how fast you move.
This guide assumes the compromise has already happened and you are dealing with the aftermath. If you are still working out whether your site has actually been hacked at all, checking whether a site is hacked and what to do first if your site is hacked cover that earlier stage.
The order that matters
-
Isolate the site
Take it offline or restrict access before you do anything else, so nothing spreads further and nobody visiting is served infected content while you work.
-
Preserve what is there now
Copy the current, compromised state before you delete or overwrite anything, in case you need to look at it again.
-
Restore from a backup taken before the compromise
Not simply the most recent backup — the most recent one you have good reason to believe is clean.
-
Rotate every credential connected to the site
Before it goes back online, not after.
-
Find and close the entry point
Skip this and a clean restore is only a temporary win.
-
Bring it back online, then keep watching
Verify carefully, and do not assume the first clean-looking page means the whole site is clear.
Step 1: isolate the site
Put the site into maintenance mode, password-protect the web root through your control panel, or ask support to suspend the account temporarily while you work. The goal is to stop anything still running — a scheduled task, a script quietly re-encrypting new uploads — from doing further damage, and to stop visitors and search engines from seeing a ransom note or malicious content in the meantime.
Change the hosting account and control panel passwords straight away, even before you get to the full credential rotation later in this guide. If an attacker still has valid access, anything you do next can simply be undone or watched.
Step 2: preserve a copy of the compromised state
Take a full copy of the site exactly as it is now, encrypted files, ransom note, unfamiliar admin accounts and all, before you restore or delete anything. You may need it later to understand what happened, to show support or a specialist what you are dealing with, or simply to check afterwards that the restore genuinely removed everything.
Download this copy, or export it through the backups section of your control panel, and store it somewhere separate from the account. Treat it as evidence rather than something to work from directly.
Step 3: identify a backup from before the compromise
Restoring the most recent backup is the wrong instinct here, because the most recent one may already contain whatever let the attacker in, or may already be encrypted or corrupted itself. Look at the dates available in the backups section of your control panel, and work backwards from the earliest point you noticed anything wrong, with a reasonable margin before it. If you are not certain when the compromise started, treat "further back" as the safer default rather than "more recent". Rolling a site back to a specific earlier date covers choosing that point in more detail.
If the compromise reached account-level storage, a backup sitting on that same account is not automatically safe just because it predates the ransom note appearing. If you have a copy stored off the account, through a downloaded archive or a separate cloud sync, check that one too, and prefer it if there is any doubt about the on-account copies.
Step 4: restore from that backup
Restoring a website from a backup covers the actual mechanics, through your control panel or by hand with the files and database together. The one addition here: restoring gets you clean files and a clean database, and nothing more. It does not, on its own, address how the attacker got in, which is exactly why the next step is not optional.
Step 5: rotate every credential, before anything goes back online
Do this before you reconnect the site, not after, and treat every one of the following as compromised until you have changed it:
- The hosting account and control panel login.
- Every FTP or SFTP account on the site.
- Every database user's password.
- Every admin account inside your CMS — and remove any admin account you do not personally recognise rather than assuming it is fine.
- Any email accounts associated with the domain, since a compromised mailbox can be used to reset other passwords straight back.
- Any API keys or third-party integration tokens the site uses.
Use long, unique passwords for each one rather than variations on a theme — choosing passwords worth having covers what that actually looks like — and turn on two-factor authentication wherever it is offered. Setting up two-factor authentication covers the accounts most worth protecting this way.
Step 6: find and close the entry point
A restore undoes the damage. It does not undo whatever let the attacker in the first time, and bringing a freshly restored site back online without fixing that is close to inviting a repeat. Common, unglamorous causes include an outdated CMS core, theme, or plugin; a weak or reused password on an account with access; and a custom script with a vulnerability nobody had patched. Run a proper scan before you go further — scanning a site for malware covers the general approach, and if the site runs WordPress specifically, cleaning a hacked WordPress site goes into the platform-specific detail.
Update everything to its current version, remove any plugin or theme you do not actively use rather than leaving it dormant, and check for anything left behind that should not be there: an unfamiliar scheduled task, an extra admin account, a file that does not belong. If you cannot identify how access happened with confidence, treat the whole account as still at risk and consider asking a specialist to look before you fully reopen it.
Step 7: bring the site back online, then keep watching
Remove the isolation you put in place in step one, then check the site properly rather than assuming a clean home page means everything is fine. Click through several pages, log in as an admin and confirm nothing unfamiliar is present, and keep an eye on the site for the following days rather than considering the incident closed the moment it loads again. If the site was flagged by a browser or search engine while compromised, clearing a "deceptive site" warning covers getting that lifted once you are confident the site is genuinely clean.
On paying the ransom
Paying does not guarantee that files are actually decrypted or handed back, and it does nothing to close the entry point the attacker used, which means the underlying problem is still there whether you pay or not. We do not recommend or facilitate paying a ransom. A clean backup from before the compromise, restored properly and followed by the steps above, gets you to a genuinely trustworthy state — paying does not.
After the incident
An incident like this is the clearest possible argument for the basics being in place before you need them: backups that are actually tested, at least one copy stored away from the hosting account, and a written plan for what you would do next time so you are not making every decision under pressure for the first time. A disaster recovery plan for a small website covers turning what you just did into something written down and ready before it is needed again.
If you are unsure about any of these steps or do not have the technical confidence to carry them out alone, contact our support team with the date you believe you were compromised and what your backups currently cover. Getting the restore point and the order of operations right matters more here than moving quickly.
Related reading
A restore overwrites the live site with the backup, so do it in the right order — here is what that order is.
What to do first if your website is hackedA calm, ordered checklist for the first hour: contain it, change every credential, restore clean, then find how it got in.
How to scan your site for malwareThe practical ways to actually check your files for malicious code, and how to read the results without missing what matters.
A disaster recovery plan for a small websiteMost small sites have a backup, but no plan for actually using it — write the decisions down before you need them, not during.