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.

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

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

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

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

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

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-by–step/(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

Even well-known software and plugins can have vulnerabilities. Stay informed by following cybersecurity news:
- Hacker News – Reports on the latest hacking trends
- WP Hacked Help Blog – Offers WordPress-specific security tips
- Daniel Miessler – Shares insights on website security
- IT Security Guru – Covers cybercrime and ransomware news
- Security Weekly Blog – Provides weekly cybersecurity updates
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

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:
- MxToolBox – Scans for spam blocklisting and domain issues
- Domain DNS Health Checker – Examines server, email, and DNS health
If Google or email providers blocked your site, clean up the infection and request removal from their lists.
8. Reset the .htaccess File

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

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

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:
- AVG Free Antivirus – Blocks malware and phishing attempts
- Avast Free Antivirus – Protects against ransomware and Wi-Fi security threats
- Avira Free Security – Scans for viruses, phishing attempts, and performance issues
- Kaspersky Security Cloud – Uses AI-powered threat detection
- Malwarebytes – Specializes in removing hidden malware
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.
Related articles

Mar 10, 2025
Read more
The Benefits of Jamstack
Jamstack boosts SEO with fast load times, better indexing, and lower bounce rates, helping your site rank higher and improve user experience.

Mar 04, 2025
Read more
How to Prevent Your Website from Cyber Attacks
Protect your website from cyber attacks with key security tips. Learn how to prevent hacks, safeguard data, and keep your site secure.

Feb 27, 2025
Read more
How to Perform an SEO Audit for Your Website
Perform a complete SEO audit to improve rankings, fix technical issues, optimize content, and boost site performance with this guide.

Feb 24, 2025
Read more
Headless CMS: Unlocking WordPress Potential
Discover how headless CMS with WordPress revolutionizes site performance, boosting flexibility and solving modern business challenges.

Feb 20, 2025
Read more
The Growing Influence of Minimalist Web Design
Enhance user experience with minimalist web design—clean, fast, and functional websites that improve engagement and focus on what matters.

Feb 18, 2025
Read more
Dark Mode vs. Light Mode: Which is Better for UX?
Dark or light UI? UX design affects readability, usability, and user experience. Learn how the environment influences the best choice.