Home / Blog / Your site was hacked: what to do in the first 24 hours
Updated: 2026-12-01 · 12 min read · Vladyslav Koshelyev

Your site was hacked: what to do in the first 24 hours

In short: do not delete the site or restore an old backup right away. First, save a copy of the hacked state, change all passwords, and block access to the admin panel. Then find out how they got in, and only after that clean up. Otherwise, in a week the site will be hacked again the same way.

Your site was hacked: what to do in the first 24 hours

I regularly clean hacked sites on WordPress, OpenCart, and custom-built CMSs. Almost always, the owner is the last to learn about the hack: from a client who was redirected to a casino on their phone, from the hosting provider that blocked the account, or from Google, which flagged the site as dangerous. Below is the procedure that preserves data and keeps the attacker from coming back.

How to tell that a site has been hacked

  • From mobile or from search, the site redirects to a third-party resource, but when visited directly from a computer, everything is fine.
  • In Google, a search for site:вашсайт shows pages with Japanese or Chinese titles, casinos, and medicines.
  • The browser shows a red warning, and Search Console has a Security Issues section.
  • Unfamiliar administrators have appeared in the admin panel.
  • The hosting provider reports spam mailings or high load.
  • Clients complain about card charges after paying on the site.
  • Files with suspicious names and recent modification dates have appeared on the server.
Plan for the first 24 hours after a site hack: first hour, first 6 hours, first 24 hours
Action plan for the first day

First hour: stop the damage

  1. Make a full copy of the files and database in their current, infected state. You need it to find the entry point. Store it separately from working backups.
  2. Save the server logs: access.log and error.log for recent weeks. Many hosts keep them for only a few days.
  3. Change passwords: hosting, FTP and SSH, database, CMS admin panel, domain email, domain registrar. Start with email: it is used to recover all other access.
  4. Enable maintenance mode or password-protect the site if it is stealing card data or sending viruses. For a store this is painful, but it is the lesser evil.
  5. Remove extra administrators and end all active sessions.
Do not restore a backup right away. If the vulnerability remains, the site will be infected again within hours. You will also lose the traces that can help find the hole, and orders since the backup.

First 6 hours: find how they got in

Without this step, cleaning is useless. Typical entry points on small business sites:

Entry pointHow to check
Outdated plugin or modulecompare versions with vulnerability databases, for example WPScan for WordPress
Nulled theme or hacked modulelook in the code for obfuscated inserts, calls to eval and base64_decode
Stolen passwordadmin panel and hosting login log, logins from unfamiliar IPs and countries
Neighboring site on the hostingseveral sites in one account without isolation are infected at the same time
File uploadPHP files in image and upload folders
Open backups and configsarchives, .env, .git in the site root

Look in the logs for the first requests to malicious files: usually nearby you can see which address was used to upload them. Compare the files with a clean version of the same CMS version: anything that differs and is not your own customization is suspicious.

First 24 hours: clean up and close the door

  1. Replace the CMS core, themes, and plugins with clean copies from official sources.
  2. Remove shells, backdoors, and inserts in the database: scripts in settings, widgets, and product descriptions.
  3. Update everything to current versions and remove unused plugins and themes.
  4. Close the entry point you found.
  5. Set correct file permissions and block PHP execution in upload folders.
  6. Check the site as a search bot and from mobile: some viruses show only to them.
  7. In Search Console, submit a review request in the "Security Issues" section.

If customer data was stolen

If there are signs that personal data or card data leaked, this is no longer just a technical task. Notify the acquiring bank and the payment system if a skimmer was on the payment page. Consult a lawyer about how and whom to notify under your country's law. Honest notification of customers preserves more trust than silence that later comes to light.

How to prevent it from happening again

  • Update the CMS and plugins weekly or at least once a month.
  • Two-factor authentication in the admin panel, on hosting and in email.
  • Daily off-server backups with restore testing.
  • Monitor file changes and get alerts about new administrators.
  • Protect the admin panel and forms with a WAF. For setup details, see website protection from DDoS and bots.
  • Security audit once a year and after major changes.
Six measures that protect a site from being hacked again
Six measures against repeat hacking

Why there are more hacks

AI has sped up both sides. Attackers take apart released fixes in minutes and write attack code for old plugin versions. Mass scanners check millions of sites a day. A site that has not been updated for six months almost certainly contains a known vulnerability, and a bot will find it before you do. The good news: most such attacks are stopped by updates, two-factor authentication and backups.

When to call a specialist

You can handle a simple infection yourself if you are confident working with files and the database. Call a specialist if the site makes money every day, has card payments, the infection came back after cleaning, or Google is already showing a warning. I provide website malware removal with finding the entry point and a security audit to find the other weak spots.

FAQ

What to do first if your site was hacked?

Make a copy of the infected site and logs, change all passwords starting with email, remove extra administrators, and if needed put the site into maintenance mode. Restoring a backup and cleaning the site should only be done after finding the entry point.

Can I just restore an old backup?

You can as a temporary measure, but the vulnerability will remain, and the site will be infected again. You will also lose orders and changes made since the backup date. First find out how they got in, then restore and close the hole immediately.

How do I remove Google's hacked site warning?

Clean the site, close the vulnerability, and submit a request for review in Search Console under 'Security Issues'. The review usually takes from one to several days.

How much does it cost to fix a hacked site?

Fixing a site on a CMS with entry point investigation usually costs from $150. The price is higher if several sites on the hosting are infected, there is custom code, or data needs to be recovered from damaged files.

Why was the site hacked if no one needs it?

Most attacks are automated. Bots look for known vulnerabilities across all sites and use hacked sites for spam, redirects, and attacks on other resources. Business size does not matter.

Let’s talk about your project

Describe the task in a couple of sentences — I reply within one business day. Free and no obligation.

Telegram   Discuss a project

AI assistants for your industry

Services

🤖

AI integration for business

from $400
💬

AI chatbot development for business

from $500
💻

Website development

from $500
✈️

Telegram bot development

from $300
📈

SEO services

from $270/mo
🖥️

Website maintenance, servers & DevOps

from $130/mo
⚙️

Business process automation with n8n and AI

from $150
📱

WhatsApp chatbot development for business

from $800
🧑‍💻

Claude Code setup for development teams

from $300
🛍️

E-commerce website development

from $2,000
🚀

High-converting landing page development

from $500
📸

Instagram DM chatbot for business

from $600
🏢

Corporate website development

from $1,200
🧩

WordPress development

from $500
🔍

SEO audit with a prioritized fix plan

from $250
⚡

Website speed optimization and Core Web Vitals

from $150
💜

Viber chatbot development

from $400
🔗

CRM integration for websites and messengers

from $300
🎨

Website redesign without losing rankings

from $900
🧭

Custom web application development

from $1,500
🚚

Website migration without losing rankings

from $300
🛒

OpenCart & ocStore development

from $150
🟢

Shopify store development

from $200
🦾

AI agent development for business

from $1,000
📞

AI voice agent for phone calls

from $1,500
🧭

AI search optimization (GEO)

from $300
📱

Telegram Mini App development

from $1,200
🔌

ChatGPT integration for your website and workflows

from $400
📊

Google Analytics 4 and conversion tracking setup

from $150
🛠

Website maintenance plans

from $100/mo
💳

Payment gateway integration

from $150
🔄

Product feeds and marketplace integration

from $200
🌐

Multilingual Website Development

from $300
🔗

Website Integration with 1C and BAS

from $400
📚

AI Knowledge Base: an Assistant That Knows Your Documents

from $700
🕷️

Web Scraping and Data Collection Services

from $150
🛍️

AI Product Descriptions for Online Stores

from $200
🧾

AI Document Automation

from $300
🛡️

Website malware removal and hack repair

from $150
📞

AI sales call analysis

from $400
🔐

Website security audit and penetration testing

from $250
🧱

Website protection from DDoS attacks and bots

from $120
🤖

Security for AI bots and assistants

from $300
🤝

Hire a Ukrainian AI developer

from $400
🎙️

Voice Tasks in Telegram for Managers

from $600