How to recover a hacked website, step by step.
What to do in the first hour, how to find the way in, why a clean rebuild beats cleaning in place, and how to stop it happening again. Written for owners, not developers, with WordPress steps and a short path for every other platform.
- 12-minute read
- Any hosting company
- WordPress and other platforms
- 1Contain · First hourTake it offline, change every password, save a copy
- 2Investigate · 1 to 3 hoursFind when it happened and how they got in
- 3Rebuild clean · 2 to 6 hoursFresh files, your content carried over
- 4Harden · 1 hourUpdates, firewall, two-factor, offsite backups
- 5Clean up · Days, mostly waitingGoogle review, blacklists, two weeks of watching
About a working day for a small WordPress site. Hill City Web: we do the whole thing for a fixed $450, working within 48 hours of access.
Do not try to clean a hacked website in place. Rebuild it from sources you know are clean, carry over only your content, then close the door the attacker used. Cleaning file by file almost always misses a hidden backdoor, and the site is reinfected within days.
The order matters: contain first, investigate second, rebuild third. People who skip to the rebuild usually get hacked again through the same hole.
- Google shows pages you never wrote, often about pills, casinos or designer goods, under your domain.
- Visitors are redirected to another site, sometimes only on phones or only from Google.
- A red “Deceptive site ahead” or “This site may be hacked” warning appears in the browser or in search results.
- Your host suspends the account or emails about malware, or spam goes out from your domain.
- You cannot log in, there is an administrator you did not create, or the site is suddenly very slow.
1Contain · The first hour, any platform
Stop the damage before you fix anything.
Three things, in this order, whatever your site runs on. They take under an hour and stop visitors, Google and the attacker while you work out what happened.
Take the site offline.
Put up a maintenance page, or ask your host to block the site. If the host already suspended it, leave it suspended for now. A hacked site that stays up keeps sending visitors to the attacker and keeps earning the “deceptive site” warning.
Why it matters: every hour online with malware adds to the damage to your reputation with Google and with customers, and it is the one step that costs nothing.
Change every password, from a clean computer.
Hosting account, website login, database, FTP or SFTP, the domain registrar, and the email address those accounts recover to. Each new password should be long, unique and stored in a password manager. Revoke any API keys, application passwords and connected apps you do not recognise.
Why from a clean computer: if the hack started with malware on your own laptop, changing passwords on that laptop hands the attacker the new ones. Run a full antivirus scan on it first, or use a different machine.
Download a full copy, files and database.
Even though it is infected. Use the host's backup tool or file manager to save everything, and export the database. Label the folder with today's date and keep it off the live server. You will use it to find out how the hack happened and to recover content.
What not to do: do not restore a backup yet, and do not start deleting files. You do not know yet which backup is clean or where the way in was.
Which kind of website do you have?
Phases 2 and 3 depend on what your site runs on. Most hacked small-business sites run WordPress, and that is the full path below. If yours is something else, the right steps are shorter.
WordPress
Also WooCommerce stores and most sites built by a local designer.
- Follow phases 2 to 5 below in full.
- Expect an outdated plugin or a weak admin password to be the cause.
Continue to phase 2 ↓
Website builder
Wix, Squarespace, Shopify, GoDaddy Website Builder, Weebly.
- The platform owns the servers, so the “hack” is almost always a stolen login or a rogue app.
- Reset the password, turn on two-factor sign-in, remove collaborators and apps you do not recognise.
- Check the pages, redirects and injected code settings for changes, then contact the platform's support.
Then skip to phase 4
Another CMS
Joomla, Drupal, Magento, PrestaShop, Craft.
- Phases 2 and 3 apply as written. Swap “plugins” for extensions or modules.
- Reinstall the core and every extension from the official download, restore only content and media.
- Check the platform's own security announcements for the hole that was used.
Continue to phase 2 ↓
Custom or static
Hand-coded sites, plain HTML, older PHP sites with no CMS.
- Usually the hosting or FTP password was stolen, or the server itself is outdated.
- Wipe the web folder and upload a fresh copy from your local files or code repository.
- No copy anywhere? Rebuild from the saved copy after a careful scan, or treat it as a new site.
Then skip to phase 4
Not sure what your site runs on, or who hosts it? Send us the address and we will tell you, free. Contact Hill City Web.
2Investigate · WordPress and other CMS
Find out when it happened and how they got in.
You need two facts before rebuilding: the date the first bad file appeared, and the hole it came through. Both live in your hosting panel and your website admin.
Sort the files by date and find the first bad one.
In the host's file manager, sort the website folder by “last modified”. Look for PHP files inside the uploads folder, files with random names, and files changed at odd hours on days you did not touch the site. Open suspicious files only to look, never to run them. The earliest suspicious date is when the hack began.
Common hiding places: wp-content/uploads, the theme folder, the root folder next to index.php, and a fake plugin folder with a plausible name.
Check the users and the plugins in your admin.
Log in to the website admin. Under Users, look for administrators you did not create, especially ones with odd usernames or recent registration dates. Under Plugins and Themes, note anything with an update waiting, anything you do not recognise, and anything installed around the hack date.
If you cannot log in: the attacker may have changed your password or email. Reset through the host's database tool or ask the host to do it, then continue.
Work out the way in.
Nine times out of ten it is one of these: a plugin or theme that was months out of date, a weak or reused admin password, a “nulled” premium plugin downloaded free from a shady site, another site on the same hosting account, or the host's own server. Match the hack date to the plugin's security announcements if you can find them.
Why this step cannot be skipped: if you rebuild without knowing the hole, the attacker walks back in through it, often the same week.
Pick the backup you will restore from.
Under Backups, find the newest copy from before the hack date. That is your clean candidate. If your host keeps only seven days of backups and the hack is older, you will restore content only, not files. Note this now so phase 3 does not surprise you.
Ask the host too: many hosts keep more backups than they show, and their support can tell you when their scanner first flagged the account.
| Hosting company | Where to log in | File manager | Backups | Malware scanner |
|---|---|---|---|---|
| GoDaddy | My Products, then Web Hosting | cPanel File Manager | Website Backup, or cPanel JetBackup | Website Security, paid add-on |
| Bluehost | Hosting dashboard | cPanel File Manager | CodeGuard, or cPanel backups | SiteLock, paid add-on |
| SiteGround | Site Tools | Site, then File Manager | Security, then Backups, daily, included | Security, then Site Scanner, paid |
| Hostinger | hPanel | Files, then File Manager | Files, then Backups, included | Security, then Malware Scanner, included |
| WP Engine | User Portal | SFTP only | Backup points, daily, included | Handled by WP Engine, open a ticket |
| Any cPanel host | yourdomain.com/cpanel | Files, then File Manager | Files, then Backup or JetBackup | Varies, often ImunifyAV |
Menu names as of November 2026. Hosts rename things, so if a label is missing, search the panel for “file”, “backup” or “security”.
3Rebuild clean · WordPress and other CMS
Rebuild from clean sources. Do not patch.
This is the part people get wrong. Deleting the files you found and restoring the rest leaves behind the one you did not find. Wipe the lot and bring back only what is yours.
Keep the site offline and make one more copy.
You already have the infected copy from phase 1. Before deleting, confirm it opened and that the database export is complete. This is your safety net if the rebuild goes wrong.
Delete the entire website folder.
Everything in the web root, usually public_html. Not just the files you found. Backdoors hide in places that look harmless, such as a one-line addition to a legitimate plugin file.
Clean backup from phase 2? If you have a full backup from before the hack date, you can restore it instead of a fresh install, then update everything immediately. Still treat the uploads and database as below.
Install WordPress, your theme and your plugins from fresh downloads.
Download the current WordPress from wordpress.org, the theme from its author, and each plugin from wordpress.org or the developer's own site. Never copy plugin or theme folders back from the old site, even ones that look fine. Drop any plugin you no longer use, and any “nulled” premium plugin for good.
Bring back the uploads folder, after scanning it.
Copy wp-content/uploads from your saved copy, then search it for any file ending in .php, .phtml or .js and delete them. The uploads folder should contain only images, documents and video. Many hosts' malware scanners will do this check for you.
Restore the database, then clean it.
Import your database export into a new database with a new password. Then search it for the usual signs of injection: “<script” tags, “eval(”, “base64_decode” and unknown links in the posts, options and widgets tables. Delete every administrator you did not create and reset the passwords of the ones you did.
Why a new database password: the old one was in the infected wp-config.php, so the attacker has it.
New wp-config.php, new salts, then bring it back online.
Let the fresh install create wp-config.php with the new database details, and generate new security salts from the official WordPress salt generator. Log in, check the pages, the forms and the checkout if you have one, then remove the maintenance page.
4Harden · Any platform
Close the door, then add a few more locks.
The rebuild fixes today. These seven changes are what stop next month. None of them need a developer, and the first one is the one that matters most.
- Update everything, then keep updating weekly. WordPress, theme, plugins, and PHP on the host. Turn on automatic updates for plugins you trust. Out-of-date plugins are the single biggest cause of hacked small-business sites.
- Delete what you do not use. Inactive themes and plugins still run code when attacked. Keep one theme and only the plugins you need.
- Strong, unique passwords and two-factor for every administrator. Use a password manager. A free two-factor plugin adds a code from your phone at login.
- Limit login attempts and hide nothing you rely on. A login-limit plugin stops password guessing. Renaming the login page helps a little, but it is not a substitute for the above.
- Put a firewall in front. Cloudflare's free plan, or a WordPress firewall such as Wordfence or Solid Security, blocks known attack patterns before they reach the site.
- Scan daily and get the email. Your host's scanner or a security plugin, set to email you when something changes. Silence is only reassuring if something is listening.
- Backups off the server, kept for 30 days. Daily backups stored somewhere other than the hosting account, with enough history to reach back past a hack you only noticed later.
- Block PHP from running in uploads, and turn off the file editor. Two small settings a security plugin or your host can apply. They remove the two most common ways a hacked site gets a backdoor.
On a website builder, this list collapses to three items: a unique password, two-factor sign-in, and a review of connected apps and collaborators every few months.
5Clean up · Any platform
Clear your name with Google, then keep watching.
The site is clean, but Google, browsers and spam filters still remember. This phase is mostly asking for reviews and waiting, with one check a day for two weeks.
Request a review in Google Search Console.
If Google flagged the site, Search Console shows it under Security Issues. Once the site is clean, click Request Review and describe in a few sentences what you found and what you did. Clear reviews are usually processed in one to three days. While you are there, check the Pages report for spam URLs still in the index and request their removal.
No Search Console yet? Set it up now. It is free, it is how Google tells you about the next problem, and the verification takes five minutes.
Check blacklists and your email.
Hacked sites are often used to send spam, which lands the domain on blocklists and bounces your real email. Run the domain through a free blacklist checker and Google's Safe Browsing status page. If your business email uses the same domain, send a test to a Gmail address and check it did not land in spam.
Watch the logs for two weeks.
Once a day, glance at the scanner email, the Users list and the file manager sorted by date. Attackers often return to the same entry point within days. If anything new appears, you now know exactly how to handle it, and it means phase 2 missed the real door.
Write down what happened.
Half a page: the date, the sign, the cause, what was rebuilt, what was hardened. If you ever hire someone to look after the site, it is the first thing they will ask for.
We do all five phases for $450.
A website rescue is this guide done for you: diagnosis, a backup before anything changes, the clean rebuild, hardening, the Google review and a plain-English report of what happened. Fixed price, working within 48 hours of getting access, and credited in full if you later build a new site with us. If the site turns out to be past saving, we say so before charging anything more.
How do I know my website was hacked and not just broken?
Broken sites show errors. Hacked sites show things you did not put there: new pages in Google, redirects, a browser warning, an administrator you did not create, or spam from your domain. If your host or Google has contacted you about malware, it is a hack. If you are unsure, send us the address and we will look, free.
Can I just restore a backup and move on?
Only if the backup is from before the hack and you fix the way in straight after. Restoring a backup that already contains the backdoor puts you back where you started, and restoring a clean one without updating the plugin that was exploited gets you hacked again. Phases 2 and 4 are what make a restore stick.
How long does recovery take?
For a typical small WordPress site, about a working day of effort, spread over two to three days because Google's review and blacklist removals take time. Larger sites with online stores take longer because the database needs more careful checking.
Will my Google rankings recover?
Usually, yes. Once the review clears, the warning disappears within a day or two and rankings return over the following weeks as Google recrawls the clean pages. Spam pages that were indexed should be removed through Search Console so they stop showing under your name.
Do I need to tell my customers?
If the site collected customer data, such as a store with accounts or a form that stored submissions, you may have a legal duty to notify people, and you should talk to a lawyer about your state's rules. For a brochure site with a contact form, a short note on the site and to recent contacts is good practice.
WordPress hacked: is the process different?
The five phases are the same. On WordPress, reinstall core, your theme and your plugins from official downloads, carry over only your content, and remove any administrator you did not create. If you would rather have WordPress malware removal done for you, our $450 website rescue covers it.
What does your website rescue include?
Everything on this page, done for you, for a fixed $450: diagnosis, backups before and after, the clean rebuild, hardening, the Search Console review and a written report. We start within 48 hours of getting access. If you go on to build a new site with us, the $450 is credited in full. Details on the rescue page.
Not sure where to start? Send us the address.
We look at the site before we reply, at no cost, and tell you whether it is hacked, what probably happened, and whether a $450 rescue is the right fix.
Or reach us directly
- (908) 739-2044Call or text
- hello@hillcityweb.comEmail us anytime
- Summit, NJMon–Fri 9am–8pm, Sat–Sun 9am–5pm