Skip to content
( Informative )

How to Restore a Hacked WordPress Website (Step-by-Step Guide)

April 12, 20254 min read
How to Restore a Hacked WordPress Website (Step-by-Step Guide)

Getting hacked is one of the worst nightmares for a WordPress website owner. A hacked site can lead to data loss, malware infections, Google blacklisting, and security vulnerabilities. If your site is compromised, acting fast is crucial to prevent further damage.

In this step-by-step guide, we’ll walk you through how to restore a hacked WordPress website, remove malware, and secure your site from future attacks.


Signs That Your WordPress Website Has Been Hacked

Before restoring your website, confirm whether it has been hacked. Here are some common signs of a hacked WordPress site:

βœ… Unexpected Redirects – Visitors are being sent to malicious websites. βœ… Google Blacklisting Warning – Your website appears with a β€œThis site may be hacked” warning in Google search. βœ… Strange Admin Users – New unknown admin accounts appear in your WordPress dashboard. βœ… Injected Spam Content – Your website displays unwanted pop-ups, ads, or spammy links. βœ… Unusual Server Resource Usage – Your site is suddenly consuming high CPU or bandwidth. βœ… Defaced Website – Hackers change your homepage or add offensive content. βœ… Malware Alerts from Hosting Provider – Your hosting company notifies you about malicious activity.


Step-by-Step Guide to Restoring a Hacked WordPress Website

Step 1: Stay Calm & Put Your Website in Maintenance Mode

πŸ›‘ Don’t panic! The first thing you should do is temporarily take your site offline to prevent further damage.

πŸ”§ How to do it:

  • If you can access your WordPress dashboard, install the WP Maintenance Mode plugin.
  • If you don’t have access, use cPanel or FTP to display a temporary maintenance page.

πŸ“Œ Purpose: This prevents users and search engines from accessing a compromised website.


Step 2: Scan Your Website for Malware

Now, check for malware, infected files, and unauthorized changes.

πŸš€ Best WordPress Malware Scanners:

  • Wordfence Security – Free security scanner & firewall.
  • Sucuri SiteCheck – Online malware scanner.
  • MalCare – Automated malware removal tool.

πŸ”§ How to scan your site:

  1. Use Wordfence Security – Go to Wordfence β†’ Scan and start a full scan.
  2. Check your hosting panel – Some hosts like SiteGround, Kinsta, and WP Engine offer built-in malware detection.
  3. Use Google Safe Browsing – Check if Google has flagged your site by searching:

πŸ“Œ Purpose: This helps you identify the source of the hack.


Step 3: Reset All Passwords & Revoke Unauthorized Users

πŸ”‘ Immediately change passwords to prevent further unauthorized access.

βœ… Change the following:

  • WordPress admin password
  • Hosting cPanel password
  • FTP/SFTP credentials
  • Database password
  • Email account passwords (if compromised)

πŸ”§ Remove Unknown Users:

  1. Go to Users β†’ All Users in WordPress.
  2. Delete unknown admin accounts.
  3. If you see new administrator accounts that you didn’t create, your site has been compromised.

πŸ“Œ Purpose: Prevent hackers from regaining access to your website.


Step 4: Restore Your Website from a Clean Backup

If you have a recent clean backup, restore your site to before the hack.

πŸš€ How to restore a backup:

  • If using UpdraftPlus, go to Settings β†’ UpdraftPlus Backups β†’ Restore.
  • If your host offers automatic backups (like Kinsta, Cloudways, or SiteGround), restore from the last known good version.
  • For cPanel users, go to File Manager β†’ Restore Backup.

πŸ“Œ What if You Don’t Have a Backup?

  • Proceed to Step 5 to manually remove malware and fix your site.

Step 5: Manually Remove Malware & Malicious Code

If you can’t restore from a backup, manually clean infected files.

πŸ”§ Steps to remove malware manually:

  1. Access your website files via FTP or cPanel File Manager.
  2. Check core WordPress files (wp-config.php, .htaccess, index.php) for suspicious code.
  3. Delete unknown PHP files from /wp-content/themes/ and /wp-content/plugins/.
  4. Reinstall WordPress core files by uploading fresh versions from WordPress.org.

πŸ“Œ Warning: Be careful when deleting filesβ€”removing critical files may break your site.


Step 6: Reinstall WordPress Core, Themes & Plugins

To ensure no hidden malware remains, reinstall WordPress core files, themes, and plugins.

πŸ”§ How to do it:

  1. Reinstall WordPress Core: Go to Dashboard β†’ Updates β†’ Reinstall WordPress.
  2. Delete all inactive themes & plugins: Go to Plugins β†’ Installed Plugins and delete unnecessary ones.
  3. Manually reinstall your theme and plugins: Download fresh copies from the official WordPress repository.

πŸ“Œ Purpose: Removes backdoors hackers may have left behind.


Step 7: Secure Your Website & Prevent Future Attacks

Now that your website is clean, protect it from future hacks.

πŸš€ Essential Security Measures: βœ… Install a security plugin – Use Wordfence or Sucuri to monitor for attacks. βœ… Enable Two-Factor Authentication (2FA) – Prevents unauthorized logins. βœ… Limit Login Attempts – Install Limit Login Attempts Reloaded plugin. βœ… Disable XML-RPC – Prevents brute force attacks (use the Disable XML-RPC plugin). βœ… Move wp-login URL – Change your login URL using WPS Hide Login. βœ… Schedule daily backups – Use UpdraftPlus or Jetpack Backup. βœ… Use a Web Application Firewall (WAF) – Cloudflare or Sucuri for extra protection.


Final Thoughts

Recovering from a WordPress hack can be stressful, but following these step-by-step actions will help you restore your site safely and prevent future attacks.

βœ… Key Takeaways: βœ”οΈ Scan your site for malware & suspicious activity. βœ”οΈ Reset passwords & remove unauthorized users. βœ”οΈ Restore from a clean backup if available. βœ”οΈ Manually remove infected files if no backup exists. βœ”οΈ Reinstall WordPress core, themes, and plugins. βœ”οΈ Implement security best practices to prevent future hacks.

By securing your site properly, you can keep hackers out and maintain a safe WordPress website for the long term! πŸš€

Leave a comment

Your email address will not be published. Required fields are marked *

Call +91 90580 76906
Back to top Chat on WhatsApp
Before you go

Got a project in mind?

Leave your email and I will send a free, no-obligation plan for your website within 24 hours.

  • Free site review
  • Clear quote, no surprises
  • Reply within 24 hours