Signs Your Website Has Been Hacked and How to Clean It Up

Strange redirects, spam pages in Google, unknown admin users or a browser warning can all mean your site has been hacked. Here is how to confirm it and clean up properly.

Appspine Team 11 Nov 2026 7 min read 9 views
Signs Your Website Has Been Hacked and How to Clean It Up
On this page

The most common signs of a hacked website are visitors being redirected to spam or scam sites, strange pages (often in Japanese or about pharmacy products) showing up in Google, a "Deceptive site ahead" or similar warning in browsers, new admin users you did not create, and files on your server you do not recognise. If you see any of these, assume the site is compromised until proven otherwise.

Cleaning up properly means more than deleting the obvious bad files. You need to remove every back door, close the hole the attacker used, and ask Google to lift any warnings. This guide walks through each step.

Warning signs your website has been hacked

Attackers usually want your site to keep working, so the damage is often hidden. Watch for these signs:

What visitors and customers notice

  • Redirects to gambling, dating, fake prize or scam pages, sometimes only on mobile or only for visitors arriving from Google, so you may not see it yourself.
  • Browser or search warnings such as a red full-screen warning, or "This site may be hacked" under your listing in Google.
  • Pop-ups or ads you did not add, or a defaced home page.
  • Antivirus alerts when people visit your site.

What you notice in Google and your tools

  • Spam pages in search. Search Google for site:yourdomain.com. Pages you never created, often selling medicines, luxury goods or written in another language, are a classic sign of a "spam injection" hack.
  • Google Search Console alerts. The Security issues report tells you when Google has detected hacked content or malware on your site. If you have not set up Search Console, do it now; it is free.
  • Traffic changes. A sudden drop in search traffic, or a spike in pages you do not recognise in analytics.

What you notice on the server

  • Unknown admin or FTP users, or password reset emails you did not request.
  • New or recently changed files, especially PHP files in upload or image folders, or files with random names.
  • Changes to .htaccess or other server configuration that add redirects.
  • Unfamiliar scheduled tasks (cron jobs) that re-create malicious files after you delete them.
  • Your server sending spam email, often discovered when your emails start landing in spam or your host warns you.
  • A warning or suspension from your hosting company, or unexplained high CPU usage.

Before you start: do not make it worse

When people discover a hack, the instinct is to start deleting things. Pause for an hour and do these first:

  1. Write down the time you noticed the problem.
  2. Take a full copy of the site files, database and server logs as they are now. You need this to understand what happened and, if necessary, for reporting.
  3. Put the site into maintenance mode or take it offline if it is harming visitors, for example by serving malware or redirecting to scams.
  4. Check whether personal data is involved. If customer data, payment details or login data may have been accessed, follow a full data breach response, not just a website clean-up.
  5. Report if required. In India, CERT-In's 2022 directions list website intrusion, defacement and insertion of malicious code or links among the incidents that covered organisations must report to CERT-In within six hours of noticing them.

How to clean up a hacked website, step by step

Step 1: Change every password and key. That includes hosting control panel (cPanel or similar), FTP and SSH, database users, website admin accounts, email accounts tied to the site, domain registrar, CDN and any API keys stored in config files. Do this from a computer you trust, as a compromised office PC can leak new passwords too.

Step 2: Remove unknown users and access. Delete admin accounts, FTP accounts and SSH keys you do not recognise. Remove old staff and former agency accounts while you are there.

Step 3: Find the entry point. Look at server access logs around the time the first malicious file appeared. Common entry points are an outdated plugin or theme, an old PHP version, a vulnerable upload form, a weak or reused admin password, and a leaked password in a code repository. If you skip this step, the attacker will be back.

Step 4: Restore or rebuild from a clean source. The safest option is to redeploy your code from version control (such as Git), or restore files from a backup taken before the hack, then compare against the current server to spot anything extra. If you have neither, every file has to be reviewed or replaced with fresh copies of the CMS, themes and plugins.

Step 5: Clean the database. Attackers often hide scripts or spam links inside posts, pages, settings or widget content. Search the database for script tags, iframes, unfamiliar domains and encoded code.

Step 6: Check the hidden places. Review .htaccess files in every folder, cron jobs, the upload folders (there should be no PHP files there), and any file with a recent modification date you cannot explain.

Step 7: Patch and harden. Update PHP to a supported version, update the CMS, plugins and libraries, remove anything unused, disable script execution in upload folders, add login rate limits and two-factor authentication, and fix the specific weakness from Step 3.

Step 8: Scan and verify. Run a malware scan from your host or a reputable security tool, browse the site on mobile and desktop, and recheck site:yourdomain.com for spam pages.

Step 9: Ask Google to review. Once all issues are fixed on all pages, use Request Review in Search Console's Security issues report, explaining what you fixed. Remove or return a 404 for any spam URLs the attacker created so they drop out of search results.

A quick clean-up checklist

TaskDone?
Copy of files, database and logs saved before changes☐
All passwords, keys and tokens changed☐
Unknown users, FTP accounts and SSH keys removed☐
Entry point found and fixed☐
Files restored or redeployed from a clean source☐
Database searched for injected scripts and links☐
.htaccess, cron jobs and upload folders checked☐
PHP, CMS, plugins and libraries updated; unused ones removed☐
Malware scan clean; site tested on mobile and desktop☐
Google review requested; spam URLs removed☐
CERT-In report made, if required☐

How to stop it happening again

A clean-up fixes today's problem. These habits stop the next one:

  • Keep code in version control and deploy from it, so you always know what should be on the server and any unexpected change stands out.
  • Never edit live files directly; make changes in the repository and deploy them.
  • Automate off-server backups and test a restore every few months.
  • Update monthly and apply security updates as soon as they appear.
  • Monitor: uptime alerts, Search Console notifications and a periodic look at your server logs.
  • Limit access: individual logins for each person, two-factor authentication, and remove accounts when people leave.

If your site has been hacked more than once, or the code is too old to patch with confidence, it is time for a proper review. Our security and code audit identifies how the site is exposed and what to fix first. Where a rebuild makes more sense, our web application development team builds on a supported stack with version control and automated deployment from day one, and our integrations and launch work covers hosting, monitoring and handover. Tell us what you are seeing and we will advise on next steps.

Frequently asked questions

Why would anyone hack a small business website?

Most attacks are automated and not personal. Bots look for any site with a known weakness, then use it to host spam pages, redirect visitors, send spam email or spread malware. Small sites are attractive because they are often less well maintained.

Can I just restore a backup?

Restoring a clean backup is often the best start, but it is not enough on its own. If you do not change passwords and fix the weakness the attacker used, they can get back in within hours. Also make sure the backup was taken before the hack began.

How long does it take for Google to remove a hacked warning?

After you request a review in Search Console, Google re-checks the site. Google says a review for hacked content can take from a few days to a few weeks. The warning is removed only once Google finds no remaining issues, so fix everything before you request a review.

My site keeps getting reinfected. Why?

Usually because a back door was missed, such as a hidden PHP file, a cron job or a rogue admin user, or because the original weakness was never fixed. A thorough file comparison against a clean source and a code review usually finds the cause.

Do I need to tell my customers?

If personal data such as customer details, logins or payment information may have been accessed, yes, you should treat it as a data breach. Once the DPDP Act's breach provisions apply from 13 May 2027 (as of November 2026), you must inform affected people and the Data Protection Board.

Sources

Share
Appspine

Written by the Appspine team

We are an app and software development company in Noida, India, with 200+ projects delivered and apps live on the App Store and Google Play. Rated 4.5★ on Clutch and 5.0★ on Google.

Free consultation

Turn this idea into your app

Share a few details. We will call or WhatsApp you with a clear plan and free estimate. No spam, no obligation.

Accepting New Projects

Build the
future together.

Building scalable mobile apps, web platforms and custom software for startups, growing businesses and enterprises worldwide.

Trusted by Global Partners

EN
ST
+40
Trusted Software Company

Delivering Excellence Globally.

Appspine is a premier software company dedicated to building high-performance mobile apps, scalable SaaS products, and custom digital solutions — trusted by clients across the globe.

10+ Countries
200+ Projects
99% Satisfaction
Appspine Global Presence World Map
USA
Germany
Nigeria
Brazil
France
Russia
India
Japan
Australia
AAppspine Assistantnow