Security · 3/24/2026 · Alfred
My WordPress Site Has Been Hacked - What Do I Do?
Emergency guide for hacked WordPress sites: immediate containment steps, malware removal, recovery procedures, and security hardening to prevent future attacks.
- What should I do in the first 30 minutes after discovering a hack?
- 1. Take the site offline immediately
- 2. Change all passwords now
Discovering your WordPress site has been hacked triggers immediate panic. Your business presence is compromised, customer data may be at risk, and every minute the site stays online, it potentially spreads malware to visitors. The good news: most hacked sites can be fully recovered with the right sequence of actions. This guide provides a clear, step-by-step emergency response plan to contain the damage, remove the infection, and prevent future attacks.
What should I do in the first 30 minutes after discovering a hack?
Speed matters. The first 30 minutes determine how much damage spreads and how difficult recovery becomes. Attackers often install backdoors, redirect traffic, or use your server to launch attacks against other sites. Your immediate goal is containment.
1. Take the site offline immediately
Contact your hosting provider and ask them to suspend the site or put it in maintenance mode. If you have cPanel or similar access, rename the main index.php file temporarily. This stops visitors from accessing infected pages and prevents Google from flagging your site as malicious.
2. Change all passwords now
Change passwords for your WordPress admin account, hosting control panel, FTP/SFTP accounts, database, and any associated email accounts. Assume all credentials are compromised. Use strong, unique passwords you have never used before.
3. Document everything
Screenshot any suspicious behavior, note when you first noticed the hack, and list any recent changes you made to the site. This documentation helps identify the attack vector and proves useful if you need to file reports or insurance claims.
4. Check your backups
Verify whether you have a clean backup from before the hack occurred. Do not restore yet - just confirm a viable backup exists. Note the date of the last clean backup.
How do I assess what was compromised?
Understanding the scope of the breach guides your recovery strategy. Different attack types require different responses. A defaced homepage differs significantly from a site infected with credit card skimming malware.
Identify the attack type
Common WordPress compromises include:
- Defacement: Homepage replaced with hacker messages or political content
- Redirects: Visitors sent to spam sites, phishing pages, or adult content
- Malware injection: Hidden malicious code serving viruses or stealing data
- SEO spam: Thousands of spam pages created to manipulate search rankings
- Backdoor installation: Hidden access points allowing attackers to return
Scan for malware
Use multiple scanning tools to identify infected files:
- Wordfence Security plugin (if you can access admin)
- Sucuri SiteCheck (external scanner at sitecheck.sucuri.net)
- Your hosting provider's malware scanner
- Manual review of recently modified files via FTP
Check for unauthorized users
Review all WordPress user accounts. Delete any accounts you did not create. Check for admin accounts with suspicious email addresses. Ensure your own account has the correct email and role.
Review recent file changes
Access your site files via FTP or file manager. Sort by modification date. Files changed around the time of the hack warrant close inspection. Look for PHP files in upload directories (wp-content/uploads should not contain executable files).
According to Sucuri's 2024 Website Threat Research Report, 44% of hacked WordPress sites had at least one vulnerable plugin installed, making plugin security critical for prevention.
Overwhelmed by the recovery process?
Our security specialists can assess the damage, remove malware, and restore your site within 24 hours. We handle the technical complexity so you can focus on running your business.
What are the recovery steps to clean my site?
Once you understand the scope, begin systematic cleanup. The safest approach combines restoration with fresh installation of core components.
Option A: Restore from clean backup (recommended if available)
If you have a verified clean backup from before the hack:
- Completely delete all current site files and database
- Restore files and database from the clean backup
- Immediately update WordPress core, themes, and plugins to latest versions
- Change all passwords again (database, WordPress, hosting)
- Scan the restored site to confirm cleanliness
Option B: Manual cleanup (if no clean backup exists)
Without a clean backup, you must surgically remove malware:
- Download a fresh copy of WordPress from wordpress.org
- Replace all core WordPress files (wp-admin, wp-includes, root files)
- Delete and reinstall all plugins from the official repository
- Delete and reinstall your theme (or switch to a default WordPress theme)
- Manually review wp-content/uploads for malicious PHP files
- Scan the database for suspicious content (spam links, malicious scripts)
- Check .htaccess files for unauthorized redirects or rewrite rules
Verify complete removal
Before going live, run multiple verification scans:
- Google Safe Browsing check
- Sucuri SiteCheck scan
- Wordfence deep scan
- Manual review of key files (wp-config.php, .htaccess, index.php)
How do I prevent future WordPress hacks?
Recovery means nothing if attackers return through the same vulnerability. Implement these security hardening measures immediately.
Keep everything updated
Outdated software causes 44% of WordPress hacks according to Sucuri's 2024 hacked website report. Enable automatic updates for WordPress core, and establish a weekly schedule to update plugins and themes.
Install a security plugin
Choose one comprehensive security solution:
- Wordfence Security (firewall, malware scanning, login protection)
- Sucuri Security (monitoring, hardening, post-hack features)
- iThemes Security (30+ ways to secure your site)
Harden WordPress configuration
- Change the default admin username
- Limit login attempts to prevent brute force attacks
- Enable two-factor authentication for all admin accounts
- Move wp-config.php outside the web root if possible
- Disable file editing in the admin dashboard
- Use strong, unique passwords for database and hosting
Implement regular backups
Set up automated daily backups stored offsite (not on your hosting server). Test restoration monthly to ensure backups work when needed.
Use a web application firewall (WAF)
A WAF blocks malicious traffic before it reaches your site. Options include Cloudflare, Sucuri, or your hosting provider's built-in firewall.
When should I call professional security experts?
Some situations exceed DIY recovery capabilities. Consider professional help when:
- You process customer payments: E-commerce sites handling credit cards require PCI compliance verification after breaches
- The site remains reinfected: Persistent malware suggests hidden backdoors you have not found
- You lack technical expertise: Incorrect cleanup attempts can destroy data or leave vulnerabilities
- Google has blacklisted your site: Professional help accelerates reputation recovery and removal from blacklists
- Customer data was accessed: Legal notification requirements may apply depending on your jurisdiction
- You have no clean backup: Manual cleanup requires advanced technical knowledge
Professional security services typically cost between $300-$2000 depending on site complexity and damage severity. This investment protects your business reputation and prevents recurring cleanup costs.
Conclusion: Act Fast, Recover Completely
A hacked WordPress site feels catastrophic, but recovery is achievable with systematic action. The key steps remain constant: contain the damage immediately, assess the full scope, clean thoroughly using either backups or manual removal, and harden security to prevent recurrence.
Time is your enemy during a breach. Every minute of delay allows malware to spread, search engines to flag your site, and customers to encounter dangerous content. Follow this emergency response plan to minimize damage and restore normal operations quickly.
Most importantly, treat this incident as a learning opportunity. The security measures you implement today prevent far more costly breaches tomorrow. Your website represents your business credibility - protect it with the same diligence you apply to physical premises and financial accounts.
Frequently Asked Questions
How do I know if my WordPress site has been hacked?
Common signs include unexpected redirects to spam sites, defaced pages, unfamiliar admin users, sudden traffic drops, Google warning messages in search results, hosting suspension notices, or antivirus software flagging your site as dangerous.
Can I recover my WordPress site without a backup?
Yes, but it requires technical expertise. You must manually replace all core WordPress files, reinstall plugins and themes, clean the database of malicious code, and remove backdoors. Without proper knowledge, you risk leaving hidden malware or breaking functionality.
How long does it take to recover a hacked WordPress site?
With a clean backup, recovery takes 2-4 hours. Manual cleanup without backups typically requires 1-3 days depending on site complexity and infection severity. Professional services often complete recovery within 24 hours.
Will my SEO rankings recover after a hack?
Yes, if you act quickly. Submit a reconsideration request to Google after cleaning your site. Rankings typically return within 2-4 weeks, though severe or prolonged infections may take longer to fully recover.
How much does professional WordPress malware removal cost?
Professional cleanup services range from $300 for simple sites to $2000+ for complex e-commerce platforms with extensive damage. Monthly security monitoring services typically cost $50-$200 per month depending on site requirements.
Let's Talk
Talk through the next move with Pro Logica.
We help teams turn complex delivery, automation, and platform work into a clear execution plan.

Alfred leads Pro Logica AI’s production systems practice, advising teams on automation, reliability, and AI operations. He specializes in turning experimental models into monitored, resilient systems that ship on schedule and stay reliable at scale.