Hacked Website Repair: Definitive Guide
by
7-layers of Security for Your WordPress Site
Your website needs the most comprehensive security to protect it from the constant attacks it faces everyday.

When a website’s security is compromised, it starts to behave oddly. Tell us, have you seen any of this happening?
These are signs that your site might be hacked. Your first priority is to scan it for malware right away.
The bad news is you are in need of hacked website repair. The good news is it can be done. The best news is you’ve found the right place to help you.
We’ve cleaned over 20,000 hacked websites. We’ve seen almost every type of hack. More importantly, we will help restore your site and protect it from future harm.
TL;DR: Remove all hacks from your site in 5 minutes. Hacks aren’t a minor issue—they can cause more damage over time if ignored. MalCare allows you to remove every bit of malware from your site with just one click.
Understanding the process to repair a hacked website
Recovering from a website hack begins with knowing how they get hacked in first place, and then what it takes to fix them.
It involves four steps:
- Scanning your site for hacks (which include backdoors)
- Fix the hacked website
- Stop future website hacks
- Revert any damage caused by the hack
Hacks cause huge losses for businesses and individuals.
We’ve seen sites defaced, filled with spam pages and links, SEO rankings drop, and even legal troubles arise.
You might spend a lot to clean a hacked site, only for the problem to return the next day. (This is why scanning for website backdoors is super important.)
Hacks worsen over time. Hackers, once controlling your site, will steal data, misuse your resources, and use your site to attack others. Many web hosts suspend accounts for this reason.
💡 Act quickly and choose the most effective way to fix your hacked site. There’s a lot at stake.
Step 1: Scan your website for hacks
Scan your site for malware thoroughly to find well-concealed malware.
All you need to do is install MalCare on your website. MalCare will scan your website automatically. In a matter of minutes, you will know if your website is hacked.

Deep scanners are the perfect way to locate malware as they crawl through every nook and corner of your website and find even the slightest hints of malware, even if it is hidden in the most unlikely spaces.
Why choose MalCare when there are many malware scanners out there?
MalCare’s scanner is free to use. After getting a clear report of a hack on your site, you can upgrade to use the auto-clean feature, which removes malware instantly from files and the database.
MalCare doesn’t use file matching to find malware. Instead, it has a sophisticated algorithm that checks 100+ signals in the code before deciding if it’s safe or dangerous.
Other security plugins match files to a database of hack signatures, and if they find a match, they label it as malware. This method is flawed and can lead to false positives and missed malware. For new hacks not in the database, this method fails.
We recommend MalCare because we’ve handled and cleaned thousands of hacks. Every week, worried site admins email us because they can’t log in or their web host has suspended their account due to detected malware.
Other ways to scan your site
Scan your website with an online scanner
Online scanners such as the Sucuri Site Check scan the visible parts of your website for malware. While this is not completely effective, it can be a good first step in your diagnostics process.
Certain types of malware can show up on the visible code of your website as these hacks alter the frontend code of your website.
But bear in mind that online scanners cannot be the only tool you use for diagnosing your website. If you get a positive result for malware, you can rest assured your site is hacked. Conversely, though, a clean chit doesn’t mean that your site isn’t hacked.
Scan your website manually
You can scan your website for malware manually. But we absolutely do not recommend this course of action. We are including this section so that you know all your options, but unless you know exactly what you are doing, it is unwise to do so. Chances are that you will miss something or potentially flag legitimate code as malware.
Additionally, there is no blueprint for malware. Junk code could be anything and hide anywhere on your website. So you have to be well acquainted with the code in the first place to detect malware.
Having said that, the first step to identifying malware manually is to look up the recently modified files on your website. You can do this through the File Manager. If you haven’t made the changes to the file that shows up, it is most likely malware.
The best course of action, as we have previously mentioned, is to use a security plugin like MalCare. MalCare is thorough and fast, which is necessary because hacks should be dealt with quickly. Once you have a definitive answer to whether or not your site is hacked, all you need to do is upgrade to clean it.
Symptoms of a hacked website
You cannot always be sure if a website is hacked. Depending on the type of malware, the symptoms of a hack can vary, or not appear at all. And if you’re not sure what to look for, malware can sneak up on you.
Given that hacks get worse with time, it is important to identify them quickly. Therefore, you should know what symptoms to look out for in case you have a hacked website.
Some simple diagnostics to run
While scanning is the best way to find a hack, there are also some other simple ways in which you can diagnose a hack on your website. These diagnostics are not as accurate as security scanners but can give you a good insight into the health of your website.
These diagnostics can show up symptoms and give you a fair idea regarding the security of your website. But you should still use a security scanner to confirm the hack and be thorough.
Step 2: Repair a hacked website
Remove the hack with MalCare, the most effective and quickest way to repair your hacked website. MalCare is designed by security experts after painstaking research and development. This expertise allows you to clean up every trace of malware from your site with the click of a button.

Why do we recommend MalCare?
Many security plugins are available for websites, but we (obviously) choose MalCare every time. This choice comes from thorough testing and research. MalCare stands out for several reasons:
Other methods for hacked website repair
Hire a security expert
Another way to repair your hacked website is to hire a security expert who can manually clean your website for you. While this is not the best course of action, it is still preferred to a DIY clean-up.
Cleanup services by experts take time, as they do it manually. And consequently, they are expensive. While we cannot guarantee the quality of the services provided by every security solution, MalCare offers an emergency service with your subscription, if you require additional support along with the plugin clean-ups.
This also applies to repeated hacks or malware, where experts usually charge a fee per clean-up, but MalCare’s services are covered throughout the year within your subscription.
Repair your hacked website manually
Manual cleanups are not the most effective or quick, because unless you are a security expert, a lot of what you do will be trial and error. This takes time, which can worsen the hack. But if you accidentally make a mistake, it can actually worsen your situation.
We often deal with frantic calls from website admin who have tried to clean up their website manually and broken their website by accident. This takes way more time to fix than if you use any other method in the first place.
If you still need to repair your hacked website manually for any reason, here is how you can do it.
- Make sure you have access to your website
In case your web host has suspended your account, and you have lost access to your website, the first thing to do is regain access. You can email your web host and request them to grant access for cleanup purposes. If they do not comply, you will have to use FTP to get a copy of your website, so you can clean it locally.
If you are facing a web host account suspension, you can also ask them for the list of malware on your website.
- Take a backup of your website
The next step is to back up your website. It may be hacked, but at least you still have a website. In case something goes wrong during the cleanup, you can always restore it. But without a backup, you may lose all your website data if everything doesn’t go according to the plan.
- Download WordPress core, plugins, and theme files from the repository
Before you can start cleaning, you need a reference. For this, you need to download clean installs of the WordPress core, plugin, and theme files. You can download them from the WordPress repository. But make sure that you download the same versions as the ones on your website. Otherwise, there may be differences in the code and you won’t be able to compare files.
- Reinstall WordPress core
Now comes the tricky part. You will have to reinstall the core files to your website. Start with the wp-admin and wp-includes folders. You can directly replace these two folders as they do not contain any user content.
Once this is done, check the wp-uploads folder. This folder should not have any malicious PHP files. So if you come across any, delete them. Now you have to start looking for strange code in the files. Look into these files specifically:
- index.php
- wp-config.php
- wp-settings.php
- wp-load.php
- .htaccess
We realize that strange code is a vague explanation but there isn’t one specific code that constitutes malware. So you will have to be extra careful. Especially since these are core files, do not delete anything unless you are absolutely sure it is malware.
- Clean plugins and themes
Moving on, it is time to clean up the plugin and theme files. You will find these files in the wp-content folder. You will have to compare the clean installs with the files on your website. This can take a significant amount of time, so we recommend using an online diffchecker for this. This will help you find any differences in the two files. You can start by looking for the following active theme files:
- header.php
- footer.php
- functions.php
Note: Given that themes and plugins are customizable, the customizations can show up as additional code. So in case you are deleting any code that is different from the clean installs, it might wipe out the customizations or stop the plugins and themes from working.
- Clean database tables
The final step in the core clean-up process is the database. To clean up the database tables, you will require phpMyAdmin with which you can download and open the database tables and take a look at the code.
Now take a look at the database tables and see if you find any odd code or scripts. Start with your existing pages and posts because you know how they are supposed to look. You can find them in the wp-posts table. Also, look for newly created pages and posts, and see if you find any that were not created by you. Next, you can look into the wp-options table. These two tables often carry malware.
- Remove all the backdoors
The cleaning of the files is only half the battle won. The malware came from backdoors in your website, and as long as the backdoors are still there, your site is still at risk. So the next step is to remove all the backdoors.
Backdoors can be present anywhere on your website so you need to look for them thoroughly. You can look for popular backdoor keywords such as eval, base64_decode, gzinflate, preg_replace, or str_rot13.
Note: These keywords are often present in backdoors but they also have some legitimate uses in plugins and themes and deleting these could cause problems in the functioning of the extensions.
- Reupload clean files
It is now time to reupload all your cleaned files back onto your website. You need to first delete the existing files and database and then re-upload all the files that you have cleaned. You can use File Manager and phpMyAdmin for this.
Given that this process is exactly like restoring a manual backup, you can take a look at our comprehensive guide on how to do that.
- Clear cache
The last thing to do is to clear the cache on your WordPress website. Cache is used to create copies of your website in order to load it faster. But if your website is hacked, chances are that the cached versions of it also have traces of malware. So even after the cleanup, your website might still have malware.
So to remove malware entirely from your website, clear the cache entirely from your website.
- Use a security scanner to confirm
The worst is over, the clean-up is done! Now all you need to do is use a security scanner to confirm that your website is malware-free. This step is important because it tells you if your attempt was successful. If yes, you can move forward. But if not, you will have to recheck everything again. In this case, it is best to invest in a security solution.
Step 3: Prevent your website from getting hacked again
Your website is now malware-free. But did you know that a hacked website has a higher chance of getting hacked again? You might have spent hours or days cleaning up your website and still see another hack in a few weeks. This can be disheartening, but there are ways to avoid any future hacks.
Step 4: Revert the damage of a website hack
A website hack affects your business, and users in many ways. Once the website is hacked, there is already a ton of damage, as we discussed earlier. You will need to take steps to revert this damage. Here are a few measures you can take to recover from a hacked site.
What is the impact of a hacked website?
A hack can get your website blacklisted, your web host account suspended, and leave you with no website. But is that all? The impact of a hacked website is a lot more profound than the immediate effects. Hacks often lead to SEO manipulation that distorts your search rankings and visibility,If not fixed in time, the consequences of a hack can get exponentially worse. These are some of the ways in which a hack can impact you:
This list is not exhaustive in any way. Depending on your website, the nature of your business, and the data on your website, the impact of a hacked website can be far wider.
How did your website get hacked?
Given that your website is made up of code, hacks are common. Because code cannot be foolproof, and there is no such thing as a 100% secure website. But that does not mean you cannot prevent hacks at all. In fact, with the right measures, you can secure your website really well.
So if you’re wondering how your website got hacked, it is probably one of the following reasons.
Undetected backdoors
As we discussed in a previous section, website backdoors are a big risk. Backdoors are basically loopholes in the website code that hackers exploit in order to gain access. These backdoors are usually injected through malware in one way or another. Since hackers design malware so that it stays hidden, backdoors often go undetected unless you have a strong security plugin.
Vulnerabilities in themes and plugins
Your themes and plugins files may have vulnerabilities that are exploited to hack your website. Vulnerabilities are mistakes or oversights in the website code that occur due to human error. Vulnerabilities, by themselves, are inevitable. But hacks can be prevented by frequently updating your website.
Developers patch vulnerabilities as soon as they are discovered, but in order to get the patch, you need to update your themes and plugins. If you have a strong security plugin like MalCare, it will detect vulnerabilities, as well as help you update themes and plugins from the dashboard itself.
Poor user management
If your users all have more access than they require, or their accounts aren’t secured, it can lead to a hack. The best course of action is to follow the principle of least privilege and hand down the access only as needed.
Also, it is important to delete old or inactive user accounts as they can be exploited by hackers to gain access.
Web host issues
While a rare occurrence, your web host could be responsible for a hack on your website. This hack could originate in the cPanel itself or one of the software that your web host uses. When this happens, all the websites on the web host’s servers are vulnerable to hacks.
If you find no other reason for your website getting hacked, look for the recent communication from your web host. Most web hosts usually inform their customers in case any issues arise from their end.
Unsecured communication
If your communication is unsecured, it can be intercepted by hackers or anyone on the same network as you. In order to avoid this, it is important to use SSL on your website.
SSL encrypts the communication to and from your website, so that no data or information falls into the wrong hands.
Why do websites get hacked?
Attackers and malicious actors hack websites for several reasons. But the primary reason that websites get hacked is that every website is valuable. Websites have resources that can be exploited if they are hacked. Even small websites can be used as a part of a botnet or their data can be exploited for phishing scams.
With bots being easy to use, brute force attacks are not even high effort. Hackers have to do very little to try and break into your website, and the payoff is still pretty good. Some hackers also hack websites for confidential information or financial data that can be exploited.
Given that hackers have nearly nothing to lose when they attack your websites, the onus of security falls onto the website admin. It is best to use a security plugin like MalCare to secure your website from any potential attack.
Conclusion
Website security is not a one-time task. You need a security plan that is frequently updated and worked upon. In order to do this, you also need to stay informed on website security.
One of the best ways to secure your website, in the long run, is to use a security plugin like MalCare. MalCare’s firewall protects your website from attacks and alerts you in case it finds anything suspicious on your website.
FAQs
My website is hacked, what should I do?
If you think your website is hacked, scan your website to confirm. Use a deep scanner such as MalCare’s which will scan your entire website and notify you of any malware if detected. If the scanner detects a hack, all you need to do is click the ‘auto-clean’ button and MalCare will take care of the cleanup for you.
What happens if your website is hacked?
A hacked website can have far-ranging consequences, including but not limited to, customer loss, revenue loss, legal issues, data loss, business interruption, loss of brand reputation, loss of customer trust, and plummeting SEO rankings. These consequences can seriously affect the survivability of a business if not addressed in time.
How did my website get hacked?
There are several reasons for a website to be hacked, like:
- Undetected backdoors
- Vulnerabilities
- Weak passwords
- Web host issues
- Unsecured user accounts
Can a hacked website be fixed?
Yes, you can fix your hacked website. Depending on the malware and the extent of the hack, you will need to assess the damage and then take steps to clean it.
Here is how you can repair hacked website:
- Scan your website with a security plugin
- Get access to your website if it is suspended
- Clean up your website with the security plugin
- Get your website off any blacklists
Share it:
You may also like

WordPress Sending Spam Emails? Fix the Issue
Your WordPress site sends out emails, but lately there have been issues. Tell us if any of these sound familiar: If you are facing these problems, your website has most…

WordPress wp_verify_nonce – All You Need To Know About It
Every day, we log into websites and perform actions like submitting forms, updating settings, or posting comments. These actions seem simple but need protection from sneaky attacks. Imagine if someone…

Top 5 Website Vulnerability Scanners: Tried and Tested
Vulnerabilities are the main cause of many website hacks. That’s why it is so important to update vulnerable site software promptly. Doing this goes a long way in protecting your…
How can we help you?
If you’re worried that your website has been hacked, MalCare can help you quickly fix the issue and secure your site to prevent future hacks.

My site is hacked – Help me clean it
Clean your site with MalCare’s AntiVirus solution within minutes. It will remove all malware from your complete site. Guaranteed.

Secure my WordPress Site from hackers
MalCare’s 7-Layer Security Offers Complete Protection for Your Website. 300,000+ Websites Trust MalCare for Total Defence from Attacks.