Website Hacked? Exactly What to Do in the First 24 Hours

The first 24 hours should focus on three priorities: contain the attack, protect critical data, and restore your website safely.

S Sentinal Team• • 12 min read •Updated 12 Nov 2026
Website Hacked? Exactly What to Do in the First 24 Hours

Discovering that your website has been hacked can be stressful. Your homepage might display unfamiliar content, visitors could be redirected to suspicious websites, or your hosting provider may report malicious activity. In some cases, you might not notice anything unusual until customers report a problem.

If your website is hacked, every minute matters. An attacker may be using compromised accounts, stealing customer information, distributing malicious files, or attempting to gain further access to your systems.

However, panicking or deleting files without understanding the attack can make recovery more difficult.

The first 24 hours should focus on three priorities: contain the attack, protect critical data, and restore your website safely.

This guide explains exactly what to do, hour by hour, how to investigate a possible compromise, and how to reduce the risk of another attack. You will also learn how continuous website monitoring can help you identify suspicious activity earlier.

How Do You Know If Your Website Has Been Hacked?

Before starting recovery, look for signs that your website or its underlying systems may have been compromised.

Common warning signs include:

  • Your homepage displays unfamiliar text, images, or advertisements.
  • Visitors are redirected to suspicious websites.
  • Google flags your website with a security warning.
  • Your hosting provider reports malware or suspicious server activity.
  • New administrator accounts appear without your permission.
  • Your website contains unfamiliar plugins, themes, or files.
  • You notice unexpected changes to website code or configuration.
  • Your website sends spam emails without your knowledge.
  • Customers report suspicious checkout activity or unusual requests for personal information.
  • Your website becomes unusually slow or starts returning unexplained errors.

Important: A single warning sign does not automatically prove that your website has been hacked. Performance problems, configuration mistakes, and legitimate software updates can cause similar symptoms. Investigate the evidence before deciding what happened.

If you suspect a compromise, consult the Google Search Console Security Issues report to check for reported security problems.

Website Hacked? Follow This First 24-Hour Recovery Plan

The following timeline provides a practical starting point. The exact recovery time depends on the severity of the incident, your hosting environment, and whether sensitive information was exposed.

Hours 0–1: Contain the Attack Immediately

Your first priority is to stop the suspected attacker from continuing to access your website.

1. Confirm the Problem

Check your website from a separate device or browser. Review any alerts from your hosting provider, security tools, and Google Search Console.

Look for unexpected redirects, unauthorized content, suspicious administrator accounts, and security notifications.

Do not assume that your website is safe simply because the homepage loads normally.

2. Restrict Access if Necessary

If the attack is active, consider placing the website in maintenance mode or temporarily restricting public access. Your hosting provider may be able to isolate the affected website or account.

For an eCommerce website or business portal, coordinate with your technical team before taking the entire service offline. Prioritize protecting customers and sensitive transactions.

3. Preserve Evidence

Before deleting suspicious files or rebuilding the website, preserve relevant evidence when it is safe to do so.

Collect:

  • Web server and authentication logs.
  • Hosting and security alerts.
  • Screenshots of suspicious pages or redirects.
  • A copy of the affected files and database, if safely obtainable.
  • The approximate time the incident began.
  • Any unusual account activity or configuration changes.

Store evidence securely and avoid opening potentially malicious files on your normal workstation.

Why this matters: Logs and file records can help you identify the entry point, determine the scope of the compromise, and understand whether the attacker still has access.

Hours 1–3: Protect Accounts and Credentials

A compromised website may be only one part of a larger security incident. Attackers could have obtained administrator credentials, hosting access, database passwords, or access to connected services.

4. Secure Your Administrative Accounts

From a trusted, clean device:

  • Change compromised administrator passwords.
  • Secure your hosting control panel and domain registrar accounts.
  • Revoke suspicious sessions, active tokens, and unauthorized application access.
  • Enable multifactor authentication wherever available.
  • Review administrator accounts and remove unauthorized users.
  • Secure the email accounts used for password recovery.

If you suspect that your computer is infected, do not use it to change critical passwords until it has been checked and secured.

5. Rotate Exposed Credentials

If website files, configuration files, or database records may have exposed credentials, rotate the affected secrets.

Depending on the environment, these may include database passwords, API keys, deployment credentials, FTP/SFTP credentials, and application secrets.

Update legitimate applications that depend on those credentials and verify that the old credentials no longer work.

Never assume that changing your WordPress password alone will remove every attacker-controlled access method.

Hours 3–6: Identify the Entry Point

After containing the immediate threat, investigate how the compromise occurred.

6. Review Recent Changes

Examine recent activity for:

  • Newly created administrator accounts.
  • Unknown plugins, extensions, or themes.
  • Unexpected changes to website files.
  • Modified scheduled tasks or server configuration.
  • Suspicious login attempts and successful logins.
  • Unfamiliar API integrations or application tokens.
  • Changes to DNS records or website redirects.

Compare the affected website against a known-clean backup or trusted software distribution when possible.

7. Check Your CMS and Server

If your website uses WordPress, review the WordPress core, plugins, themes, user accounts, and file permissions.

Install security updates after assessing compatibility and preserving evidence. Remove software that is unauthorized or no longer needed, and investigate outdated components that may have provided an entry point.

For additional guidance, consult the official WordPress Hardening documentation.

If you use a custom application, have your developer examine application logs, authentication mechanisms, dependencies, server configuration, and deployment history.

8. Determine the Scope of the Incident

Ask these questions:

  • Was only one website affected, or were multiple sites under the same hosting account compromised?
  • Could the attacker access customer or employee information?
  • Were payment systems, email accounts, or third-party integrations involved?
  • Are there signs of data theft or unauthorized transactions?
  • Does the attacker still have a valid login, session, or backdoor?

If sensitive data may have been exposed, involve your hosting provider, security specialist, and legal or privacy team as appropriate. Follow applicable breach-notification obligations.

Hours 6–12: Remove the Threat and Recover Safely

Finding a suspicious file is not the same as completing a security cleanup.

9. Scan and Investigate the Website

Use a reputable security scanner and review the results alongside your logs and file changes.

Investigate suspicious scripts, unauthorized file modifications, malicious database entries, unexpected redirects, and persistence mechanisms.

Automated scanners can miss threats, so a clean scan alone does not prove that a website is completely secure.

10. Restore from a Known-Clean Backup

If the compromise is extensive, restoring a verified backup may be safer than attempting to repair every affected component manually.

Before restoration:

  1. Confirm that the backup predates the compromise, if possible.
  2. Check the backup for malicious files or unauthorized changes.
  3. Patch the vulnerability that allowed the attack.
  4. Restore the website in an isolated or controlled environment when possible.
  5. Rotate any credentials that may have been exposed.
  6. Verify the website and its connected services before returning it to normal operation.

Do not restore an old backup without addressing the original vulnerability. Otherwise, the attacker may exploit the same weakness again.

11. Verify Website Functionality

Before reopening the website, test:

  • Homepage and important landing pages.
  • Login and password-reset functionality.
  • Forms and email notifications.
  • Checkout and payment integrations.
  • Database connectivity.
  • Administrative permissions.
  • Mobile and desktop page behavior.
  • Unexpected redirects and suspicious outbound links.

For online stores, pay special attention to checkout integrity and customer information.

Hours 12–24: Validate Security and Monitor for Further Activity

The website may look normal after cleanup, but that does not necessarily mean the incident is over.

12. Recheck Accounts, Files, and Logs

Look for newly created accounts, unexplained file changes, repeated login attempts, suspicious scheduled tasks, and unusual outbound connections.

Confirm that unauthorized access methods have been removed and that credentials have been rotated where necessary.

13. Check Search Engine Security Warnings

Open Google Search Console and review the Security Issues and Manual Actions sections.

If Google identifies hacked content, follow its cleanup guidance. Once you have fixed the affected pages and verified the site, request a review where applicable.

A review request should only be submitted after the reported problems have been addressed.

14. Document the Incident

Create a short incident report covering:

  • What happened and when it was discovered.
  • Which systems and accounts were affected.
  • The likely entry point, if identified.
  • Data or services that may have been exposed.
  • Actions taken to contain and remove the threat.
  • Recovery and verification results.
  • Follow-up security improvements.

This record will help your team respond faster if similar activity occurs again.

15. Continue Monitoring After Recovery

Security work should not stop when the website comes back online.

Review your monitoring alerts, configure appropriate notifications, maintain secure backups, apply updates, and investigate unusual activity promptly.

This is where continuous monitoring becomes valuable. Sentinal is designed for 24/7 website monitoring, helping businesses make ongoing website security a regular part of their operations rather than relying only on occasional manual checks.

Explore Sentinal's website security monitoring to learn more.

What Should You Do If Your Website Is Hacked? Quick-Reference Table

TimeframePriorityRecommended action
0–1 hourContainmentConfirm the incident, restrict access if needed, and preserve evidence
1–3 hoursAccount securitySecure administrator accounts, revoke suspicious sessions, and rotate exposed credentials
3–6 hoursInvestigationReview logs, recent file changes, plugins, users, and server activity
6–12 hoursRecoveryRemove the threat, patch vulnerabilities, and restore a verified clean backup if necessary
12–24 hoursValidationTest functionality, review security warnings, and document the incident
After 24 hoursPreventionMaintain monitoring, backups, updates, and regular security reviews

These timeframes are guidelines, not guarantees. A serious breach involving customer data or persistent server access may require specialist incident response beyond the first day.

Website Security Scanner vs. 24/7 Website Monitoring

Website scanning and continuous monitoring serve related but different purposes. Understanding the difference helps you build a more effective security strategy.

FeatureOne-time security scan24/7 website monitoring
Primary purposeCheck for issues at a particular point in timeObserve the website continuously for supported events or changes
Coverage over timeLimited to when the scan runsOngoing, according to the monitoring service's coverage
Newly appearing issuesMay remain unnoticed until the next scanMay generate alerts when supported detection rules identify an issue
Incident responseProvides findings to investigateCan help you notice monitored changes sooner
Best usePeriodic checks and troubleshootingOngoing visibility between scheduled security checks
Main limitationCannot guarantee that no issue exists after the scanCannot guarantee detection of every attack or replace incident response

The exact capabilities depend on the product, its configuration, and the checks it performs. Neither approach guarantees complete protection.

For a business website, combining appropriate scanning, continuous monitoring, access controls, secure backups, and timely patching provides a stronger security process than relying on a single check.

How Can Sentinal Help You Monitor Your Website?

A website can be exposed to security risks at any time, including outside normal business hours. A problem that begins overnight may affect customers before your team returns to work.

Sentinal is positioned as a 24/7 website monitoring tool for businesses that want ongoing visibility into their website security.

A practical monitoring workflow should help your team:

  • Maintain awareness of monitored website conditions.
  • Review security alerts and investigate suspicious changes.
  • Identify potential problems that require further verification.
  • Prioritize investigation based on the severity of an alert.
  • Keep monitoring active after a security incident has been resolved.

Remember that monitoring is only one part of website security. Alerts need to be investigated, vulnerabilities need to be fixed, and backups and access controls need to be maintained.

Want to take a more proactive approach to website security?

Visit Sentinal to explore the monitoring solution and assess whether it fits your website security requirements.

How to Prevent Your Website from Being Hacked Again

After recovering from an incident, focus on reducing the likelihood and impact of another compromise.

Keep Software Updated

Install supported security updates for your CMS, plugins, themes, server software, and application dependencies. Remove components you no longer use.

Enable Multifactor Authentication

Require multifactor authentication for administrator, hosting, domain registrar, and other high-privilege accounts wherever supported.

Use Least-Privilege Access

Give each user only the permissions needed to perform their job. Review access regularly and remove accounts that are no longer required.

Maintain Tested Backups

Keep regular backups in a protected location separate from your primary website environment. Test restoration procedures instead of assuming the backups will work during an emergency.

Use HTTPS and Secure Configurations

Maintain valid TLS certificates, secure cookies, appropriate file permissions, and safe server and application configurations.

HTTPS protects data in transit, but it does not prevent every type of website attack.

Monitor Website Activity Continuously

Use appropriate monitoring and alerting to help your team notice suspicious activity or unexpected changes. Ensure alerts reach someone who can investigate them.

Follow a Written Incident Response Plan

Prepare a response plan before an incident occurs. Identify who can isolate the website, contact the hosting provider, preserve evidence, restore backups, and approve customer communications.

For broader incident-handling guidance, consult the Cybersecurity and Infrastructure Security Agency (CISA).

Frequently Asked Questions About a Website Hacked Incident

1. What should I do first if my website is hacked?

Contain the incident. Restrict public access if necessary, preserve evidence, and contact your hosting provider or security team. Then secure compromised accounts and investigate how the attacker gained access.

2. Can I fix a hacked website myself?

You may be able to recover a small website if you have the necessary technical knowledge, a verified clean backup, and a clear understanding of the compromise. However, persistent malware, server-level access, or suspected data theft may require a qualified security professional.

3. Should I delete suspicious files immediately?

Not automatically. Preserve relevant evidence first when it is safe to do so. Deleting files without investigation can destroy useful evidence, damage website functionality, or leave other attacker-controlled access methods untouched.

4. Will changing my website password remove the hacker?

Not necessarily. An attacker may have created another administrator account, stolen session tokens, added malicious code, or obtained access to your hosting environment. Secure all potentially affected accounts and investigate the underlying cause.

5. How long does it take to recover a hacked website?

Recovery can take a few hours for a limited incident or several days or longer for a serious compromise. The timeline depends on the affected systems, the availability of clean backups, and whether sensitive information was exposed.

6. Can Google remove my website from search results if it is hacked?

Google may show security warnings or restrict affected pages when it identifies harmful content. Review Google Search Console's Security Issues report, resolve the problems, and request a review when applicable.

7. Is a website security scan enough to prevent hacking?

No. A scan can identify certain issues, but it cannot guarantee that a website is secure at all times. Combine security scans with patching, access controls, protected backups, and appropriate continuous monitoring.

8. What is the difference between website scanning and 24/7 monitoring?

A scan checks for issues at the time it runs. Continuous monitoring observes supported signals over time and may alert you when its detection rules identify a change or problem. Both have limitations and work best as part of a broader security process.

9. How can I reduce the risk of my website being hacked again?

Keep software updated, use multifactor authentication, remove unnecessary access, maintain tested backups, secure your hosting environment, and investigate security alerts promptly. Continuous monitoring can help provide visibility between manual security checks.

10. Can Sentinal protect my website from every cyberattack?

No monitoring solution should be assumed to prevent or detect every attack. Sentinal's 24/7 monitoring can form part of a broader security approach, but you should also maintain secure configurations, apply patches, protect credentials, and follow an incident response plan.

Final Thoughts: Be Prepared Before the Next Attack

When your website is hacked, the first 24 hours should be about controlling the damage, protecting sensitive information, finding the cause, and recovering safely.

Avoid rushing into a cleanup without preserving evidence or addressing the original vulnerability. A website that appears normal after restoration may still have weaknesses that need attention.

The better long-term strategy is to combine regular maintenance, tested backups, strong access controls, security checks, and ongoing monitoring.

Don't wait until a security incident disrupts your business. Explore Sentinal's 24/7 website monitoring and take a more proactive approach to keeping your website under observation.

Share this article: LinkedIn X Facebook WhatsApp

Keep reading

Start protecting your website today

Create a free account and run your first security scan in minutes. No software to install.

Start free security check