1. Websta Hosting
Backups & Security

Understanding and Fixing a Hacked Website

Understanding and Fixing a Hacked Website

Signs your site may be hacked:

  • Visitors are redirected to spam sites
  • Google flags your site as dangerous
  • Your hosting account sends spam emails
  • You see unexpected admin users in WordPress
  • Files have been recently modified that you didn't touch

Immediate Steps

1. Take Your Site Offline

# Add to .htaccess temporarily:
Order deny,allow
Deny from all
Allow from your.ip.address

2. Change All Passwords

  • DirectAdmin password
  • FTP accounts
  • Database passwords
  • WordPress admin password
  • Email account passwords

3. Notify Our Support Team

Contact us immediately — we can run a server-side malware scan and help identify the entry point.

4. Identify Compromised Files

Check recently modified files via SSH:

find ~/public_html -name "*.php" -mtime -7 -ls

Look for base64-encoded strings (a common malware signature):

grep -r "base64_decode" ~/public_html --include="*.php" | head -20

5. Restore from Backup

If you have a clean backup from before the compromise, restore it. Update all passwords again after restoring.

6. Identify the Entry Point

Common entry points:

  • Outdated WordPress plugins or themes
  • Weak passwords
  • Compromised FTP credentials
  • Nulled (pirated) themes or plugins — never use these

7. Harden After Cleanup

  • Update all software
  • Install Wordfence for ongoing monitoring
  • Set file permissions correctly (755 dirs, 644 files)
  • Remove any inactive plugins and themes
  • Enable two-factor authentication
Still need help?

If this article didn't answer your question, our support team can help.

Contact support
All articles More in Backups & Security