Blog
Technology
How to Fix a Hacked Website: Step-by-Step Recovery Guide

How to Fix a Hacked Website: Step-by-Step Recovery Guide

Fix a hacked website fast. Learn how to remove malware, restore access, and secure your site from future attacks with this guide.
How to Fix a Hacked Website: Step-by-Step Recovery Guide

Technology keeps evolving, and cyber threats grow with it. Hackers attack 30,000 websites daily, putting every site at risk. If someone hacked your website, act fast to limit the damage. Delays can lead to lost revenue, SEO penalties, lawsuits, and harm to your brand’s reputation.

This guide helps you spot the signs of a hacked website, fix the problem, and prevent future attacks. You’ll also learn how to communicate the situation to your visitors.

How to Tell If Hackers Compromised Your Website

Cybersecurity Alert

Sourch: Preeti (2024),How to Check If Your Website Has Been Hacked, Malcare, available at: https://www.malcare.com/blog/is-my-website-hacked/(accessed 12 March 2025)

Before fixing the problem, confirm whether hackers actually breached your site. Some attacks leave obvious signs, like defaced pages or strange redirects. Others stay hidden in your backend. Look for these common red flags:

  • Google or your web browser warns users about security issues
  • Pages redirect to shady websites
  • Traffic spikes from unusual locations
  • Defaced pages or broken site elements
  • Slow website performance
  • Google removes your site from search results
  • Emails from your domain go straight to spam
  • Your hosting provider suspends your website
  • Suspicious ads appear on your pages
  • A blank white screen (aka the “White Screen of Death”)
  • Unfamiliar code appears in your site’s header or footer

Use security scanners like Sucuri SiteCheck, DeHashed, and Have I Been Pwned? to verify the breach. Check your site with multiple tools for the best accuracy.

10 Steps to Fix a Hacked Website

Malware Warning

Sourch: Preeti (2021),How To Easily Repair Hacked Website? (Complete Guide), Malcare, available at: https://www.malcare.com/blog/is-my-website-hacked/(accessed 12 March 2025)

Once you confirm the hack, follow these steps to clean up your site and secure it.

1. Stay Calm and Assess the Situation

Freaking out won’t help. A hacked website is stressful, but rushing can make things worse. Take a breath and follow these steps carefully.

2. Change All Passwords and Check Access

Password Security

Sourch: Nield.D(2020),Don’t Ignore Chrome’s New Password Checkup Feature, Wired, available at:https://www.wired.com/story/chrome-password-popups/(accessed 12 March 2025)

Hackers often break in by guessing weak passwords. Stop them by resetting every password connected to your website:

  • Hosting account
  • FTP accounts
  • CMS admin account (e.g., WordPress)
  • Database passwords
  • Email accounts linked to your site

Important: If you reused any of these passwords elsewhere, change them immediately. Never reuse passwords.

Review who has access to your site. If you use WordPress, check the Users section in the dashboard and remove any suspicious accounts.

Also, update file permissions for wp-admin, wp-config.php, your hosting panel, and FTP accounts to block unauthorized changes.

Pro Tip: Use a password manager to generate and store strong passwords securely.

3. Back Up Your Website

Backup & Restore

Sourch: Jeffrey L. Wilson(2024),4 Easy Ways to Back Up Your Website, PCmag, available at:https://www.pcmag.com/explainers/how-to-backup-your-website (accessed 12 March 2025)

Even if hackers compromised your site, backing it up still matters. Download a full backup before making major changes.

Important: Keep the hacked backup separate from older, clean backups. If something goes wrong, you’ll need a safe version to restore.

4. Find the Source of the Hack

File Manager

Sourch: 2024,How to Find and Access WordPress Error Logs (Step by Step),wpbeginer, available at:https://www.wpbeginner.com/wp-tutorials/how-to-find-and-access-wordpress-error-logs-step-bystep/(accessed 12 March 2025)

Hacks often happen after changes like installing plugins, updating themes, or tweaking code. To track the breach:

  • Check web logs for unusual activity, like sudden traffic spikes
  • Review access logs and error logs for suspicious actions
  • Look for recently added plugins, themes, or updates that introduced vulnerabilities

Pro Tip: Hostinger users can find Access Logs under the Website section in hPanel. Error logs are under PHP Configuration in Advanced.

5. Stay Updated on Security Breaches

WordPress Security

Even well-known software and plugins can have vulnerabilities. Stay informed by following cybersecurity news:

6. Contact Your Hosting Provider

Sourch: 2020,If you are the owner of this website, please contact your hosting provider, Plothost, available athttps://www.plothost.com/kb/owner-website-contact-hosting-provider/(accessed 12 March 2025)

If you use shared hosting, another compromised site on your server might have caused the attack. Cybercriminals can target your hosting account if the server is vulnerable.

Ask your hosting provider if other sites on the server got hacked. Most providers also offer server logs to track suspicious activity. If logging is disabled, request access or enable it manually.

For better security, consider switching to secure web hosting. Some hosting services, like Hostinger, offer built-in Monarx anti-malware protection.

7. Check If Google or Spam Filters Blocked Your Site

Google Security Issues

Sourch: Schwart.B(2019)New Google Search Console adds a security issues section,Search Engine Land, available at:https://searchengineland.com/new-google-search-console-adds-a-security-issues-section-311375 (accessed 12 March 2025)

Google removes hacked websites from search results to protect users. If Google blocked your site, expect a sharp traffic drop.

To check your site’s status:

  • Google Search Console – Go to Security Issues under Security & Manual Actions
  • Google Safe Browsing – Search for your domain to see if Google considers it unsafe
  • Google Analytics – Look for a sudden traffic drop, which may indicate blocklisting

Hackers can also get your domain blacklisted on spam filters, making it harder to send emails. Check your domain using:

If Google or email providers blocked your site, clean up the infection and request removal from their lists.

8. Reset the .htaccess File

File Manager

Sourch: 2021, NHow to Reset .Htaccess File, In motion hosting, available at:https://www.inmotionhosting.com/support/edu/wordpress/reset-the-htaccess-file-to-troubleshoot-wordpress-php-errors/ (accessed 12 March 2025)

Hackers often modify the .htaccess file to:

  • Redirect users to malware-infected pages
  • Turn error pages into phishing sites
  • Inject malware into PHP files
  • Expose sensitive information
  • Launch browser fingerprinting or watering hole attacks

Restore .htaccess to its original state. If you use Hostinger, reset it in hPanel’s File Manager. Also, update file permissions to prevent future modifications.

Pro Tip: If you suspect hackers altered .htaccess, rename the file and create a new one from scratch.

9. Scan Your Website for Vulnerabilities

Web Security Scan

Sourch: Mashchenko.S (2023), Online Scanner Ranking: How to Find Out Your Site’s Vulnerabilities Before Hackers Do It, available at:https://www.h-x.technology/blog/23-website-security-quick-check-services (accessed 12 March 2025)

Some security flaws remain hidden, so run a full website scan to find weaknesses before hackers do.

Use a Security Plugin or Scanner

If you use WordPress, install a trusted security plugin to detect malware and patch vulnerabilities. Consider these options:

  • Sucuri Security – Scans files, checks integrity, and helps with post-hack recovery
  • Wordfence – Provides firewall rules and malware signature updates
  • Jetpack – Includes malware scanning, real-time backups, and spam protection
  • BulletProof Security – Offers login monitoring, malware scanning, and automatic security fixes
  • WPScan – Checks WordPress core, themes, and plugins for known vulnerabilities

For non-WordPress sites, use a general security scanner like:

  • HostedScan Security – Scans networks, servers, and websites
  • Intruder – A cloud-based tool for internal and external security testing
  • Detectify – Uses ethical hacking techniques to find security issues
  • ImmuniWeb – Runs compliance-focused security tests
  • SiteGuarding – Tracks file changes, detects malware, and checks for Google blocklisting

After scanning, follow security best practices to prevent future attacks.

Expert Tip: Choose a scanner that detects all web applications on your site. If it misses sections, those areas remain vulnerable. Look for external integration to automate security monitoring.

10. Scan Your Computer for Malware

Windows Security

Sourch: HP Support(2019), Scan your Computer for Malware Using Windows Security,Youtube, available at:https://www.youtube.com/watch?v=2EKgSXM-0nU (accessed 12 March 2025)

Hackers might not stop at your website. If your computer has malware, they can steal login credentials and reinfect your site even after cleanup.

Run a full antivirus scan to find threats. If you need security software, try these free options:

For premium protection, consider McAfee or ESET.

Pro Tip: After scanning, reset your passwords to prevent hackers from regaining access.

Final Thoughts

Fixing a hacked website takes patience, but following these steps will help you recover and secure your site. After cleanup, strengthen your defenses to prevent future attacks.

If you need help, reach out to your hosting provider or a cybersecurity expert. Security threats won’t stop evolving, so stay proactive and protect your website.