Skip to content
Recovery guide · Updated November 2026

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
Recovery, step by step
yourbusiness.comHacked
  1. 1
    Contain · First hourTake it offline, change every password, save a copy
  2. 2
    Investigate · 1 to 3 hoursFind when it happened and how they got in
  3. 3
    Rebuild clean · 2 to 6 hoursFresh files, your content carried over
  4. 4
    Harden · 1 hourUpdates, firewall, two-factor, offsite backups
  5. 5
    Clean up · Days, mostly waitingGoogle review, blacklists, two weeks of watching
StatusRebuilding clean

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.

The short answer

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.

How you usually find out
  • 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.

1 2 3 Take it offline Change every password Save a full copy BACK SOON Hosting account Website login Email and domain FILES + DATABASE YOUR PC maintenance page or host block new, long, different each before anything is changed
Phase 1 at a glance. Offline first, so Google and visitors stop seeing the infected pages. Passwords second, so the attacker loses their way back in. A full copy third, so you can investigate later and recover anything you forgot.
  1. 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.

  2. 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.

  3. 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.

Before phase 2

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.

YOUR WEBSITE WordPress about 4 in 10 websites FULL PATH BELOW Website builder Wix, Squarespace, Shopify LOGIN AND APPS Another CMS Joomla, Drupal, Magento SAME LOGIC, OTHER NAMES Custom or static hand-coded, HTML files RE-UPLOAD FROM SOURCE
Not sure which you have? Log in to edit a page. A wp-admin address means WordPress. If you edit inside wix.com, squarespace.com or your Shopify admin, it is a builder. If nobody can edit it without a developer, it is probably custom code.

WordPress

Also WooCommerce stores and most sites built by a local designer.

  1. Follow phases 2 to 5 below in full.
  2. 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.

  1. The platform owns the servers, so the “hack” is almost always a stolen login or a rogue app.
  2. Reset the password, turn on two-factor sign-in, remove collaborators and apps you do not recognise.
  3. 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.

  1. Phases 2 and 3 apply as written. Swap “plugins” for extensions or modules.
  2. Reinstall the core and every extension from the official download, restore only content and media.
  3. 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.

  1. Usually the hosting or FTP password was stolen, or the server itself is outdated.
  2. Wipe the web folder and upload a fresh copy from your local files or code repository.
  3. 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.

YOUR HOSTING PANEL (every host has these five) File managerBackupsDatabasesPasswordsMalware scanner File manager Also called: cPanel, hPanel,Site Tools, My Products, Dashboard PUBLIC_HTML / NAME LAST MODIFIED wp-admin/Mar 12, 2025 wp-content/Nov 2, 2026 wp-includes/Mar 12, 2025 index.phpMar 12, 2025 wp-config.phpJun 4, 2024 wp-content/uploads/2026/11/class.php Nov 2, 2026 03:14 WHAT YOU ARE LOOKING FOR A .php file inside uploads, an odd date at 3 a.m., or core files that changed when you updated nothing. The earliest of those dates is your line in the sand.
Every hosting company has these five controls. The names change, GoDaddy calls it My Products, SiteGround Site Tools, Hostinger hPanel, most others cPanel, but a file manager, backups, databases, password reset and a scanner are always there.
  1. 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.

  2. 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.

  3. 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.

  4. 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 companyWhere to log inFile managerBackupsMalware scanner
GoDaddyMy Products, then Web HostingcPanel File ManagerWebsite Backup, or cPanel JetBackupWebsite Security, paid add-on
BluehostHosting dashboardcPanel File ManagerCodeGuard, or cPanel backupsSiteLock, paid add-on
SiteGroundSite ToolsSite, then File ManagerSecurity, then Backups, daily, includedSecurity, then Site Scanner, paid
HostingerhPanelFiles, then File ManagerFiles, then Backups, includedSecurity, then Malware Scanner, included
WP EngineUser PortalSFTP onlyBackup points, daily, includedHandled by WP Engine, open a ticket
Any cPanel hostyourdomain.com/cpanelFiles, then File ManagerFiles, then Backup or JetBackupVaries, 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.

OLD WEB ROOT wp-admin/wp-includes/wp-content/themes/wp-content/plugins/index.php, wp-config.php uploads/2026/11/class.php DELETE EVERYTHING FRESH INSTALL, FROM OFFICIAL DOWNLOADS WordPress corewordpress.org Themetheme author or wp.org Plugins, latest versionswp.org or the plugin's own site NEW wp-config.php · NEW SALTS · NEW DATABASE PASSWORD CARRIED OVER FROM THE OLD SITE, AFTER A CHECK Uploads folder Your photos and PDFs only. Delete every .php file inside it. Database Pages, posts, settings, orders. Search it for scripts and unknown users.
The rule: code comes from the original source, content comes from your old site. Code is replaceable and may be infected. Content is yours and is where the value is.
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

If no clean backup exists and the database is heavily infected, export your pages, posts and media only, through Tools, then Export, and import them into the fresh install. It is slower, and it is the only way to be sure.

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.

YOUR WEBSITE 1 · UPDATES EVERY WEEK 2 · STRONG LOGINS AND TWO-FACTOR 3 · FIREWALL IN FRONT 4 · MALWARE SCANNER 5 · OFFSITE BACKUPS, 30 DAYS KEPT 6 · FEWER PLUGINS, NOTHING UNUSED ATTACKS
Layers, not one magic plugin. Updates remove the holes. Strong logins and a firewall block the attempts. A scanner tells you early if something gets through. Backups mean that even then, recovery is an afternoon, not a crisis.
  • 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.

1 Search Console review SECURITY ISSUES · 1 REQUEST REVIEW 1 to 3 days 2 Blacklists and email Google Safe BrowsingSpam blocklistsEmail still delivered free online checkers, 10 minutes 3 Watch for two weeks RETRY logins, new files, scanner emails the attacker usually tries the old door again
Mostly waiting. Google's review takes one to three days. Blacklist checks take ten minutes. The two weeks of watching is five minutes a day, and it is when you find out whether phase 2 found the real way in.
  1. 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.

  2. 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.

  3. 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.

  4. 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.

If this is more than you want to take on

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.

Tell us what’s wrong ↗
A few useful answers

Hacked website questions.

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.

Your next step

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.

Tell us what’s wrong ↗

Or reach us directly