Discovering that your website has been hacked is a moment of panic. Your first instinct might be to delete plugins in bulk or change all passwords in a rush. But if you do that right away, you risk erasing clues about how the hacker got in, making a complete cleanup much harder.
Take a deep breath. Here’s a step-by-step guide to handling the situation calmly and effectively, minimizing the damage to your business.
Before touching anything, your goal is to contain the threat and preserve evidence. Think of it as a digital crime scene. The first thing to do is cut off public access so the hacker can’t do more damage. You can do this by putting your site in maintenance mode, using a firewall to block everyone except your own IP address, or asking your host to do it for you. The goal is to stop the infection while keeping an exact copy of what happened.
While you isolate the site, take screenshots of anything that looks abnormal: modified pages, new user accounts you don’t recognize, or strange error messages.
Before cleaning anything, make a full backupA copy of your WordPress site's files and database, saved to... More of your files and databaseWhere all WordPress content, settings, and user data are sto... More as they are right now. This may seem counterintuitive, but it’s crucial. This backupA copy of your WordPress site's files and database, saved to... More is a snapshot that could help a security expert understand how the hacker got in. Keep it in a safe place. If your host offers a server-level “snapshot” feature, this is the perfect time to use it.
Even if you’re an experienced user, most small business owners don’t have the skills of a security expert. This is the time to contact your web developer, your agency, or a specialized malware removal service. If you’re using managed hosting, their support team can also assist with the initial steps, like restoring from a server backupA copy of your WordPress site's files and database, saved to... More. A professional cleanup can take between 24 and 48 hours, but it will ensure the job is done right.
Good to know: Over 77% of hacks are due to malware, and over 96% of attacks target WordPress and WooCommerce sites. This means you’re not alone, and solutions exist.
While waiting for the experts to arrive, try to understand what type of attack it is. This helps target the response. Common signs include:
While your site is in maintenance mode, start changing all associated passwords. This includes:
Make sure each new password is strong and unique (more than 12 characters, with a mix of letters, numbers, and symbols). This is a non-negotiable step to prevent the hacker from returning with the old credentials.
This is where you have a choice.
Option A: Restore a clean backupA copy of your WordPress site's files and database, saved to... More (fastest)
If you have a backupA copy of your WordPress site's files and database, saved to... More from before the infection, restoring it is often the quickest solution. However, be cautious: if the security vulnerability isn’t fixed, the hacker can simply attack you again.
Option B: Thorough cleanup
This is the more comprehensive solution. It involves:
eval, base64_decode) and deleting files you don’t recognize, especially in the wp-content/uploads/ folder.wp-admin and wp-includes folders with clean versions from wordpress.org.wp-config.php file to invalidate all active user sessions.Important note: If you’re cleaning manually, once you’re done, run a new scan with a reputable security pluginSoftware that adds specific features or functionality to a W... More to verify nothing remains. Hackers often leave hidden backdoors.
Once the site is clean, it’s time to make it more robust. Key actions to implement include:
xmlrpc.php file.If customer data may have been compromised, you have a legal and ethical obligation to inform them. Write a clear and transparent message about what happened and the steps you’re taking to protect them.
Finally, document everything: the date of the attack, how the hacker got in, what you did to remove them, and the new security measures in place. This will help you prepare for a potential next time.
The key takeaway: A hack is a shock, but a calm and methodical response can significantly reduce the damage. Don’t try to do everything alone. Bring in professionals and follow these steps to get back to a safe and secure site.