WordPress site hacked how to fix
Is your WordPress hacked? Or do you suspect that something is awry with your website? Show
The first thing you should do if you suspect that your WordPress is hacked is to scan your website. This will confirm your suspicions regarding the hack, and help you decide the best course of action to return your site to good health. We receive emails every day from website admin who are panicking about hacked WordPress sites. Some of them have lost access to their websites due to web hosts suspending their accounts. And some have lost access to wp-admin altogether. Once you have confirmed the hack on your WordPress site, you need to Install MalCare and clean your site immediately. This step-by-step guide will help you identify the cause of the hack and protect your website from any present or future threats. WordPress has a thriving community with tons of resources, but most solutions you find are difficult to implement. So often bad advice leads to more harm than good. This can be extremely frustrating and stressful to undergo, and then you might end up feeling like the hacker has won, and your work is lost. This is not the case. If you think your WordPress site has been hacked, we will help you repair it. The important thing to remember is that hacks can be resolved. We have cleaned over 20,000 WordPress sites, and protect over 100,000 sites on a daily basis. We have distilled this wisdom into the following guide that will help you validate the hack, clean up your website, and protect it in the future. TL;DR: Clean your hacked WordPress site in 5 minutes. Hacks should not be taken lightly, as they cause exponential damage the longer they are left unaddressed. MalCare helps you surgically remove every trace of malware from your website with the click of a button. How to get rid of a hack from your WordPress site quickly?A hacked WordPress website can be a cause of panic or frustration. But don’t be alarmed, no matter how bad the hack is, we can help you fix a hacked WordPress site. Symptoms of malware on your website Malware is misleading and it can hide from you because that’s how it is designed. So it is difficult to determine if your WordPress site has malware with malware. But there are some symptoms that you can keep an eye out for. Here are a few symptoms to look out for, which can be an indicator of malware on your website:
We have explained these issues in detail in the later sections of this article if you wish to understand them better. How to scan your website for malware? Now that you know what to look out for, if you suspect a WordPress hack, the very first thing to do is to scan your website. There are three ways in which you can scan your website for hacks. Each of these ways has its pros and cons. Before you pick one, we urge you to read the related section in detail to see which one fits your requirements.
We recommend that you scan using a security scanner such as MalCare, as MalCare is built specifically to look out for hidden malware that is not easy to find with other methods. How to clean your hacked WordPress site? Now that you have confirmed the hack on your website, it is time to fix the hacked WordPress website. There are different ways to clean your website, but we strongly recommend using a good security plugin like MalCare. MalCare allows you to auto-clean your website within minutes and does not charge you per clean-up. It will also protect your WordPress site from being hacked in the future. Alternatively, we have included a manual cleaning section in the article below. However, unless you are a security expert, we do not recommend manual cleaning as it could lead to more problems than you already have.
You can go through these sections in the article to figure out which one suits you the best. But unless you are a security expert, we do not recommend cleaning hacked WordPress website manually as it could lead to more problems than you already have. How to reverse the damage caused by the WordPress hack? There are several issues that crop up once your WordPress site is hacked. Your website may have gotten blacklisted or you may have lost access to it. In order to get your site up and running again, there are a few things you need to do.
How to protect your WordPress site from being hacked in the future? Finally, once your WordPress site is clean, we’ve included a section on website security too. You’ll find tips and information on
With all of these sections, we have covered the complete guide to getting over a WordPress hack and securing your WordPress website from being hacked in the future. So if you have a hack, don’t worry. We’ve got you covered! What does it mean to have your WordPress hacked?A hacked WordPress site means your website now has malicious code. Since there are many different types of WordPress hacks, malware can be in any number of places, of multiple variants, and can manifest in different ways. For instance, one of the variants of the WordPress redirect hack infects every single post on a website—even if there are hundreds of posts. Hacks and malware cause millions in losses for businesses and individuals, derailing not only websites and user experience but SEO rankings, causing legal issues. Not to mention the immense stress of recovery. Malware creates backdoors, so even if you find and get rid of bad code, your WordPress site keeps getting hacked. The important thing to remember is that it is already bad enough to be hacked, but it gets exponentially worse with time. The longer the malware remains on your website, it will replicate itself, cause more damage, and use your site to infect other websites. In fact, if your web host hasn’t already suspended your account, it probably will. Same with Google. Scan and clean your website in minutes, and save yourself a lot of this grief. How to know if your WordPress site has been hacked?The trouble with WordPress hacks is that they are unpredictable—or rather they are designed to be unpredictable. Hackers want to confuse admin, in order to extract as much as they can from websites for as long as possible. Therefore malware can make websites behave oddly, but not necessarily all the time. For instance, an admin sees a symptom like a malicious redirect once and then doesn’t ever see it again. The same thing happens with malvertising, where ads for spammy products and services appear in between entirely benign and legitimate ads on your website. Hackers set a cookie so website admin are lulled into a false sense of security. Literally. However, if your web host has suspended your account, or your visitors see the Google blacklist warning when they try visiting your website, these are fairly reliable indications that your WordPress site has been hacked. Tip: When encountering malware or symptoms on your website, it is a good practice to note down all variables: operating system, browser, device, preceding steps, and so on. This will help in the resolution, whether you are looking for expert help or trying to clean the malware yourself. A. Symptoms of a hacked WordPress websiteEach WordPress hack is architected differently and therefore manifests in different ways. A spam link injection hack will not be the same as a remote code execution hack. So you will not see all of the symptoms below but might come across one or two. We have put together this comprehensive list of hacked WordPress site symptoms, and ordered by where the symptoms are visible. 1. Visible spam in Google search resultsYou have spent time and energy working on SEO so that your website ranks in keyword searches. We’re putting this at the top of the list because often malware is visible only to Google.
2. Problems on your websiteWordPress Hacks can show up directly on your website, for everyone to see. These are usually because the hackers want to deface the website or perpetuate a social engineering attack, like phishing. You may see these pages if you are logged in as an admin or user, but if you do see pages or posts you didn’t create, chances are they would look like one of these:
3. Changes to the backend of your WordPress websiteThese changes are often missed by website admin unless they are hypervigilant or have an activity log installed.
4. Web host flags issues with your websiteYour web host is especially invested in making sure your website is malware-free because malware on their servers causes them huge problems. Most good web hosts regularly scan websites, and inform users about malware on their sites.
5. Performance issuesMalware can cause a huge gamut of things to go bust within the website. As we said before, sometimes the symptoms are invisible, or not explicit, like a new page or new user.
6. User experience issuesAdmin are sometimes the last people to find out about hacks because hackers can hide symptoms from logged in users. Click To Tweet However, the visitors still see symptoms, which is a terrible experience and has a negative impact on your brand.
7. Unexpected behaviour in analyticsAnalytics is a source of truth for many things, and signs of a malware infection just happen to be one of those things.
There is a small chance your website could be malfunctioning because of a botched update or server issue or even a coding error. However, if you see more than one of these, your website is most probably hacked. Some key points to remember
B. Scan your WordPress website for hacksEven if you have seen several of the symptoms of hacked WordPress site from the list above, they are not conclusive indicators of a hack. The only way to know whether your WordPress is hacked is to scan your website. 1. Deep scan your website with a security pluginScan your website for free with MalCare to confirm if your WordPress is hacked. You will have an unambiguous answer about malware on your website. We recommend MalCare for a number of reasons, but mainly because we have seen and cleaned 100s of hacks from websites. Panicking website admin email us every week because they cannot login into their website, or their web host has suspended their account because of the detected malware. MalCare’s scanner is completely free to use. Once you have a conclusive report of whether your WordPress site is compromised, you can then upgrade to use the auto-clean feature to get rid of the malware instantly from the files and the database.
MalCare doesn’t rely on file matching to identify malware but has a sophisticated algorithm that checks code for 100+ characteristics before deeming it safe or dangerous. 2. Scan using an online security scannerThe second alternative to scanning your website is to use an online security scanner. Bear in mind though that all scanners are not built the same, and online security scanners are necessarily less efficient than security plugins. People might baulk at adding a security plugin to scan their website, but there’s the crux. Frontend scanners only have access to publicly visible parts of your website. It is a good thing to have code that is not publicly visible, because you don’t want your config files to be visible to everyone on the Internet. Unfortunately though, malware is not considerate enough to only attack publicly visible files. It can hide anywhere, and in fact, will hide in places that frontend scanners cannot reach. That’s why site-level scanners are most effective. Our advice is to use an online security scanner as the first line of diagnostics. If it turns out positive, that’s a good starting point to move to clean hacked WordPress website. However, a word of caution: do not rely exclusively on lists of hacked files that the scanner gives you. Those are just the ones that the scanner was able to flag. There are potentially many, many more instances of the malicious code. 3. Scan for malware manuallyAlthough we are including this section in the article, we strongly advise against anyone attempting to deal with malware manually—scanning or cleaning. A good security plugin, like MalCare, is really the way to go, because it will do everything that’s in this section, but faster and better. Remember that the WordPress hack is getting worse the longer it is left unattended. Scanning your hacked WordPress site for malware essentially means looking for junk code in files and the database. We are aware that ‘junk code’ means very little in terms of guidance, but hacks come in different forms. They each look and behave differently. We have provided code examples of hacks in a later section, but we must stress that they are indicative only. If you are opting to manually scan your website for malicious code, check for recently modified files, and make sure to look in both the files and the database. A word of caution here: update times can also be changed. A clever hacker can set the updated timestamp to something entirely different. Tip: Keep a log of your actions when scanning your website. It helps in the debugging process later on, in case your website only behaves oddly when accessed by mobile for instance. Or if you see a suspicious-looking script tag in one of the files. C. Other diagnostic steps to check for malwareThere are a few other checks that you can use to determine if your WordPress site has been hacked. Some of these overlap slightly with the symptoms listed above, but we are including them here on the off chance that the symptom didn’t appear organically. 1. Log in from an incognito browserIf you see a symptom once, like a redirect, but cannot replicate it, then try logging in from a different computer or an incognito browser. Hackers set cookies to create the illusion that any anomalies you see on your website are just that: anomalies, and not signs of hacks. Try Googling your website and clicking through from there. Does your website load correctly? How about if you put the URL directly in the browser? What happens then? We mentioned this before, but do keep notes of what you did to replicate the symptoms. Did you log in from a mobile device, or are you clicking through from Google search results? These clues help identify the hack location to some extent. 2. Check the number of pages on your websiteAs a website admin, you have an approximate idea of the number of indexed pages on your website. Google your website with the site search operator, and check the number of results. If the number of results exceeds your approximation significantly, it means that more pages of your website are being indexed on Google. If you didn’t create those pages, then they are a result of malware. The results should approximately match the number of pages on your website3. Check activity logsAn activity log is an essential admin tool for website management, especially if you want to know what each user is doing. In the case of malware, check the activity log for new users or those who have suddenly elevated privileges, like moving from Writer to Admin. Ghost users can have weird usernames or email addresses, and these are the ones to look out for. If they change a bunch of posts and pages in a short period of time, then this is a good sign that the user accounts are fraudulent. An activity log is a key part of WordPress website security4. Look for strange trends in analytics dataQuite apart from the fact that hacks can cause Google to deindex your website altogether, there are some early warning signs that you can look for.
5. Check for fake pluginsIn your website’s /wp-content folder, you should see only plugins and themes that you have installed. Any weird ones with short, meaningless names, and perhaps ones that don’t follow naming conventions are the ones to scrutinize carefully. Typically fake plugins will have a single file in the folder, or 2 at the very most. 6. Look for reported vulnerabilities in your plugins and themesOn your WordPress dashboard, look for plugins that have an ‘Update available’ tag. Next, Google to check if they have experienced any vulnerabilities recently. You can cross-reference the reported vulnerability with the type of hack it is susceptible to and figure out if your website is experiencing any of those telltale signs. An example of a reported plugin vulnerabilitySome hacks are entirely invisible to admin, and there are others that are only visible to search engines. That is the nature of malware. It is difficult to pinpoint with any degree of accuracy without a proper scanner. 7. Check the .htaccess fileThe .htaccess file is responsible for directing incoming requests to various parts of your website. For example, if your website is being accessed from a mobile device, the .htaccess loads up the mobile version of your website, instead of the desktop version. If you are familiar with core WordPress files, check out the .htaccess file. Are the user agents loading up the correct files? Malware like the SEO spam hack or the Japanese keyword hack will change the code of the googlebot user agent. Most commonly, it should load up the index.php file, but if it is hacked and a visitor clicks through from Google, an entirely different website will load instead of yours. Visiting your website directly, with the URL in the address bar, will load up the correct website, because the user agent detected is not googlebot. 8. Look for alerts from existing security pluginsAlthough this is not technically a diagnostic, we’re including previously installed security plugins in this list as well. If your security plugin scans your website regularly, it should alert you to any hacks. Depending on the security plugin you use, the alerts can be genuine or false positives. Our recommendation is to take every alert seriously because while false positives are unnecessarily alarming, on the off chance that the threat is genuine, much loss can result from ignoring a threat. With MalCare, because of the way we have built our malware detection engine, the chances of a false positive is slim to none. That’s why website admin relies on our plugin to keep their websites safe.
How to clean your hacked WordPress site?A hacked WordPress website is a scary prospect. We’ve spent a great deal of time in this article to figure out whether or not it is hacked. If you scanned with MalCare, you will have a definitive answer one way or another. There are 3 options you have when dealing with a hacked WordPress site:
We will talk about each of these in turn. A. [RECOMMENDED] Use a security plugin to clean your websiteWe recommend you use MalCare to clean your website of hacks. It is by far the best security plugin for WordPress websites, and uses an intelligent system to remove only malware, while keeping your website entirely intact. To use MalCare for WordPress hack cleanup, all you need to do is:
The cleanup takes place in a matter of minutes, and your website is pristine once again. If you used MalCare to scan your website when you were checking for malware, then all you need to do is upgrade and clean. Why do we recommend MalCare?
MalCare protects thousands of websites daily, and takes a proactive approach to website security. If you need further assistance with your website, our support team is available 24/7 to help users.
B. Hire a security expert to clean hacked WordPress siteIf your WordPress website has been hacked for a while, your web host may have suspended your account and taken your website offline. Therefore, it isn’t possible to install a security plugin to clean the hack. Don’t worry, in these cases, contact our emergency malware removal service to fix hacked WordPress site. A dedicated security expert will guide you through speaking to your web host to get IPs whitelisted to regain access, and therefore install the plugin for cleaning. If your web host refuses to whitelist IPs because of their policies, then the expert will use SFTP to clean your website of malware in the shortest amount of time. You can also opt to go with a WordPress security expert outside of MalCare. However, please be aware that security experts are expensive, and they do not guarantee against reinfection. Many security plugins that perform manual cleanups charge per cleanup, which is a cost that adds up very quickly with repeated infections. C. Clean WordPress hacked infections manuallyIt is possible to remove malware manually from your website. In fact, in extreme cases, it is sometimes the only viable option. However we keep advising against it, and we’ve expanded a little on our reasons below. If you do choose to clean up hacked WordPress website manually, then you should have a few prerequisites in order to be successful:
1. Get access to your websiteIf your web host has suspended your account, or taken your website offline, you need to regain access to it. If you use SFTP, this is not an obstacle, but it is best to ask them to whitelist your IP so that you can view the website at the very least. Additionally, the web host suspended your account after scanning your website and detecting malware. You can reach out to their support to ask for the list of infected files. Frontend scanners will also give you this information, although it may not be completely accurate and/or have false positives. 2. Take a backup of your websiteWe cannot stress this enough: please take a backup of your website before doing anything at all to it. A hacked site is much better than no site. Firstly, things can go awry when people poke around in website code, and often do. That’s when backups save the day. You can restore the website, and start again. Secondly, web hosts can delete your website altogether, if it is hacked. They have a vested interest in making sure there is no malware on their servers, and they will do whatever is necessary to ensure that is the case. If a web host deletes your website, the chances of them having a backup are slim. Getting that backup from their support is even slimmer. We strongly advocate taking your own backups always. We also recommend using a WordPress backup plugin for large files. We have seen restore fails abysmally with web host backups. When your website is hacked and you are cleaning it, you want to reduce complexity and chances of failure as much as possible. 3. Download clean installs of WordPress core, plugins and themesMake a list of the versions that are on your website, and download clean installs of the core, plugins and themes from the WordPress repository. If you weren’t using the latest version of anything, make sure to download the version that was installed on your website. This is an important step, because you will be using the installs to compare files and code first. Once you have downloaded and unzipped the installations, compare the files and folders with the ones on your website. To speed up the comparison process somewhat, use an online diffchecker to ferret out the differences in code. Incidentally, this file matching is the primary mechanism that most scanners use. It is not a perfect mechanism, because you may have important custom code that will not show up in the clean installs. Therefore, now is not the time to delete. Take lots of notes, and mark out which files and folders are different from the originals. This is also a good way to discover if your website has fake plugins installed. You will not find fake plugins on the repository, and they invariably do not follow plugin naming conventions and have very few files (sometimes just one) in the folder. Note: Are you using nulled plugins or themes? Installing nulled software is like rolling out the red carpet for malware. When you pay for premium plugins, you are getting maintained software, the expectation of support in case something goes wrong, and the guarantee of safe code. Nulled software often comes packaged with backdoors or even malware. A quick reminder to backup your website, if you chose to skip this step earlier. This is go-time. Cleaning malware out of your website is the hardest (and the most terrifying) step in this process. 4. Reinstall WordPress coreUse either File Manager in cPanel or SFTP to access your website files, and replace the following folders entirely:
You can do this without a problem, because none of your content or configurations are stored in these folders. As a matter of fact, there should not be anything in these folders that differs from the clean installations. Next, check the following files for strange code:
In a later section, we will talk about individual hacks and malware and how they appear in files and folders. Malware can manifest in many different ways, and there is no surefire way to identify them visually. You may come across advice online to look for odd-looking PHP scripts in these files, and get rid of those. However, this is very poor advice and users have flocked to our support team in the aftermath of breaking their websites. MalCare tests out each script to evaluate its behavior before determining if it is malicious or not. Speaking of PHP files, the /wp-uploads shouldn’t have any at all. So you can delete any that you see there with impunity. So we can’t actually predict what malicious code you are likely to see in any of these files. Please refer to a comprehensive list of WordPress files to understand what each does, their interconnectivity with each other, and if the files on your website behave differently. This is where an understanding of code logic will be immensely helpful. If it is an entire file that’s bad, our advice is not to delete it right off the bat. Instead, rename the file extension from PHP to something else, like phptest, so that it cannot run anymore. If it is code in a legitimate file, then you can delete it, because you have backups if something breaks. 5. Clean plugin and theme foldersThe /wp-content folder has all the plugin and theme files. Using the clean installs that you have downloaded, you can perform the same check as with the WordPress core installation and look for differences in the code. We just want to point out that changes are not necessarily bad. Customizations will show up as changes in the code. If you have tweaked settings and configurations to get a plugin or theme to work just so on your website, expect to see at least minor changes. If you don’t have an issue wiping out customization entirely, then replace all the plugin and theme files with the fresh installs. Generally, people are unwilling to write off any work they have put in, with good reason. So a lengthier method is to examine the code for differences instead. It is helpful to know what each script does and how it interacts with the rest of the website. Malware scripts can exist harmlessly in one file, until they are executed by another entirely innocuous-looking script in a completely different location. This tag team aspect of malware is one of the reasons it is so difficult to clean websites manually. Another aspect of cleaning plugins and themes is that there can be a lot of them. Going through each one is a painstaking and time-consuming process. Our advice is to start in the most typical places to find malware. In the files of the active theme, check:
In the diagnostics section, we talked about researching if any of the plugins installed had a recently discovered vulnerability. We recommend starting with those files. Questions to ask here are:
Did you find any fake plugins in the previous step? Those you can delete without a second thought. Although, don’t stop looking after that! The malware hunt isn’t over just yet. Keep in mind that malware is supposed to look normal, and will mimic legitimate file names. We’ve come across some wolves in sheep’s clothing, where the stock WordPress themes like twentysixteen or twentytwelve have small typos that make them look virtually the same. The clean installs will help with comparison and identification, but if you are unsure, contact the developers for support. 6. Clean malware from databaseExtract the database from your backup, or if you haven’t taken one as yet, use phpMyAdmin to get a download of your database.
In some cases, like the redirect hack, the wp_options table will have an unfamiliar URL in the site_URL property. If the redirect malware is in the wp_posts table, it will be in every single post. Revert modified settings to what they should be, and remove malicious content carefully. Again, depending on the size of your website, this can be a gargantuan task. The first hurdle is to identify the malware, and where it is. If it is the same malware script on each post and page, then you’re in luck. You can use SQL to extract the content from every file. However, be warned that, while removing a single lot of malware is great, you cannot be sure that’s the only hack on your website. If you have an e-commerce website, with critical user and order information, double- and triple-check you are indeed getting rid of malware only. 7. Check your root for suspicious filesWhen going through the files of your website, have a look at the root folder too. It can also have malware files stored there. All PHP files are not bad, and some plugins add scripts to the root to perform certain tasks. For instance, BlogVault adds its Emergency Connector script to the root of a website, so that the plugin can restore a backup even if the site is inaccessible. Other security plugins will flag it as malware, even those it definitely isn’t. 8. Remove all backdoorsMalware often leaves behind exploits in websites known as backdoors, just in case they are discovered and removed. Backdoors enable hackers to reinfect websites almost immediately, therefore wiping out all the cleaning effort. Just like malware, backdoors can be anywhere. Some code to look for is:
These are functions that allow external access, which is not inherently a bad thing. They have legitimate use cases, and are often altered subtly to act as backdoors. Exercise caution when deleting these without analysis. 9. Reupload your cleaned filesThe worst is over, now that you have cleaned out the malware from your website. Now it is a question of rebuilding your website. First, delete the existing files and database, and then upload the cleaned versions in their place. Use File Manager and phpMyAdmin on cPanel to do this for files and the database respectively. By now, you are a pro at handling these features. If you need more help, you can refer to our article on restoring a manual backup. The process is the same. Don’t be discouraged if large restores don’t work. cPanel struggles to handle data above a certain limit. You can use SFTP to do this step as well. 10. Clear the cacheAfter putting your site together again, and checking it a few times to see if everything works as expected, clear the cache. The cache stores earlier versions of your website, in order to reduce loading time for visitors. So that your website behaves as expected after the clean-up, empty out the cache. 11. Verify each of the plugins and themesNow that you have reinstalled your website, with cleaned versions of this software, check the functionality of each. Do they work as you expected? If yes, that’s great. If not, go back to the old plugin folders and see what didn’t make it over to the cleaned website. Chances are, some of that code is responsible for the missing functionality. You can then replicate the code to your website again, being very cautious that those bits aren’t malware-ridden. We recommend you do this one plugin and theme at a time. You can rename the plugin folders temporarily, thereby effectively deactivating them. The same method works for theme folders. 12. Repeat this process subdomains and nested WordPress installationsThis may not apply to you, but we’ve seen several websites with second WordPress installations on their main site. This could be the result of several things, like a site design, a subdomain, or even a forgotten staging site. If there was malware on your primary WordPress site, then it could and will have contaminated the nested installation. The reverse is also true. If your nested installation has malware, it will reinfect the website you just cleaned. Typically, we ask users to remove any unused WordPress installations altogether. They are an unnecessary hazard. 13. Use a security scanner to confirmYou’re almost at the finish line! This was a rough ride, and you should take a moment to appreciate the feat you pulled off. Even WordPress experts aren’t always comfortable with a WordPress hack cleanup manually, preferring to use tools instead. All that’s now left is to confirm that the malware has really gone from your website. Use MalCare’s free scanner to get that confirmation, and you are good to go! Why you should avoid manually cleaning a hacked WordPress site?We strongly advise against manual cleaning, even though we have included the steps above. If you liken a hack to an illness, you would rather a qualified medical professional perform life-saving surgery, wouldn’t you? Imagine trying to remove your appendix yourself, and you get where we are going with this analogy.
As malware replicates itself, it spreads into different files and folders, creates ghost admin users to regain entry if it is detected, and overall wreaks havoc. On top of this, recovery becomes significantly harder. We’ve had users come to us with half-destroyed websites that they’ve tried to clean themselves, failed, and now are in desperate straits, trying to save whatever is left. We can do our best, but we can’t magic back their lost data for them—a situation that could have been avoided with some timely action. The only reason we are reiterating this so many times is that we genuinely care about our users, and feel terrible every time we have to tell them that their data cannot be retrieved. To recap, here are the things that can go wrong with manual WordPress hack removal:
There are so many things that can go horribly wrong with manual cleanups. Trust us, we have seen our fair share. If your wordpress site is compromised, the best course of action to return your site to good health is to install a security plugin. Why you shouldn’t repair your website using a backup?In spite of being huge advocates of backups, we do not recommend reverting your website to a previous version. There are several reasons for this:
The only time you should consider using a backup as a starting point is if the malware has destroyed your website and data beyond retrieval. We genuinely hope that it doesn’t ever reach that stage, and installing a good security plugin will save you from these issues in the future. How to revert damage after removing hacksOnce your website is free of malware, you can now focus on reverting the damage caused by the hacks in the first place. There are two main stakeholders (apart from your visitors and you) with respect to your website: the web host and Google. Regaining access to a website Contact your web host once you are done with the cleaning, and ask them to rescan your website. You can also detail the steps you have taken in order to resolve the issue. Invariably, this will result in your access being restored and your site being back online. Getting your site removed from Google’s blacklist If your website landed up on Google’s blacklist, then you need to request a review. You can do that by going into your Google Search Console and clicking on Security Issues. There, you should see an alert for harmful content, detailing which files contain them. At the very bottom of this alert, you will find a button to request a review. You have to undertake that you have fixed the issues, and provide a detailed explanation of all the steps you took for each issue listed. Once the request is submitted, you should hear the outcome of the request in a few days. Brand damage control This step is purely optional, and it is just advice. As we will talk about later, hacks almost always damage reputation. If you can, publicly acknowledge what happened, what steps you took to fix it, and how you plan to prevent it in the future. Honesty goes a long way in rebuilding relationships, and there have been instances where well-handled hacks have led to increased brand value. How to keep your WordPress site from being hacked?One of the worst parts about malware is that it keeps coming back, either through backdoors or through exploiting the same vulnerabilities as before. We share this security checklist with our customers to help them prevent WordPress sites from being hacked in the future.
How did your WordPress website get hacked?We like to think that everything we use is 100% secure, but that’s unfortunately not true. It isn’t true of our homes, and certainly not the case with our websites. No software is completely bullet-proof, and every part of the website is essentially software: right from WordPress itself, to the plugins and themes. Vulnerabilities in plugins and themesWhen code is written, developers can make oversights or mistakes. These mistakes are called vulnerabilities. Vulnerabilities are the single biggest reason why websites get hacked. Of course, mistakes aren’t made deliberately. Vulnerabilities often just boil down to a developer writing code to accomplish one task, without realizing that a hacker can use the same code in an unintended way to gain unauthorized access to the website. A good example of this concerns the /wp-uploads folder. In the cleaning section, we mentioned that the /wp-uploads folder should never have PHP scripts. The reason being that the contents of the folder are publicly accessible via the URL and the name of the file. Therefore, PHP scripts in the uploads folder would also be accessible, and as a result, remotely executable. Therefore the folder should have a check to ensure that the uploads are not PHP files. If someone does try to upload a script, it should be rejected. To see a list of WordPress vulnerabilities, check out WPScan. This example also brings up an interesting point. One could argue that the uploads folder should not be publicly accessible, so PHP scripts would not be accessible either. However, this interferes with the functionality of the folder and is not a good fix. Similarly, we see a ton of poor security advice on the internet, which fixes a vulnerability without taking functionality into consideration. Undetected backdoorsA backdoor is very much what it sounds like: a way to gain unauthorized access without being detected. Even though backdoors are technically malware—code that has malicious intent—they are not actively damaging. They allow hackers to insert malware into the website. This distinction is important because it is the primary reason WordPress websites get hacked again after cleanups. Cleanups are effective at getting rid of malware, but not addressing the entry point of the malware. Security plugins will often flag backdoors by looking for certain functions. But there are 2 problems with this method: firstly, hackers have found ways to mask the functions effectively; and secondly, the functions are not always bad. They have legitimate uses too. Poor user management policiesThere is always an element of human error with hacks, and it mostly comes in the form of the misuse of admin accounts. As a website admin, there are a few things you should always keep top of mind when considering the security of your website. Weak passwords Yes, we know passwords are hard to remember. Especially ones that are a mix of characters, and long enough to be considered ‘safe’. However, easier-to-remember passwords are a weak link to your website security. Even a security plugin cannot protect your website if a password has been compromised. Think of your website like your home, where you’ve installed a state-of-the-art security system, like MalCare. If a thief were to learn your unique passcode to gain entry to your home, the security system wouldn’t be able to do anything. Strong passwords are critically important for all accounts, but even more so for admin accounts, which brings us to our next point. Unnecessary user privileges Users should only ever have enough privileges to accomplish what they need to on a website. A blog writer doesn’t need admin privileges to publish a post, for instance. It is very important to make sure to review these privileges regularly. Additionally, if a website admin is vigilant about user account levels, an activity log is a great tool to have as well. The activity log lists all the actions performed by users on a website and can be a great early indicator of a compromised user account. If a user who usually writes posts suddenly installs a plugin out of the blue, it is a warning sign. Old accounts are still active In addition to reviewing accounts, also remove unused user accounts regularly. If a user is no longer active on your website, there is no reason why their account should be. The reason is the same as before: user accounts can be compromised. Hackers can get hold of credentials and escalate their privileges to admin accounts. Unsecured communicationApart from the actual website, communication to and from the website also needs to be secured. If communication is intercepted and is not secured, it can be read easily. So it should be encrypted. This can be easily accomplished by adding SSL to your website. In fact, SSL is becoming the de facto standard of the internet. Google actively rewards the use of SSL, by punishing websites without it in the SERPs. Some websites show up in the search results as ‘Site not secure’, as part of their Safe Browsing initiative. On similar lines, it is always better to use SFTP instead of FTP, whenever possible. Web host issuesIn our experience, web hosts are rarely responsible for hacks. Most hosts implement loads of security measures to make sure that the websites they host are secure. For instance, people often think that their websites have got malware because they are on shared hosting plans. This is a misconception most of the time, because hosts implement barriers between sites. The real cause of cross-site infections is when there are multiple WordPress installations on a single cPanel instance. Is WordPress more prone to hacks than other CMS?Yes and No. The immense popularity of WordPress means that it attracts a lot more hackers to it. Very simply, there is a larger payoff for hackers if they are able to discover and exploit a vulnerability in the ecosystem. Additionally, WordPress-related vulnerabilities get a lot more attention, again because of its popularity. Similar instances with, say Joomla, would not merit as much discussion. In actual fact, WordPress has solved many of the problems that still exist with other CMS. It also has a terrific community and ecosystem as well. Help and support is easily available, even for niche and specific issues that a website admin may face. Understanding WordPress hacksIf you have a security plugin like MalCare installed, you don’t need to worry about hacks. We constantly upgrade the plugin to counteract new attacks, in order to protect websites better. However, it is interesting to understand how hacks work, so that you can see just how critical a good security plugin is. We’ve broken this section up into 2 parts:
Hack mechanismsPreviously in the article, we have talked about how websites get hacked. Either through vulnerabilities or backdoors, or sometimes poor passwords. These are flaws within the security of the website and are akin to weak points of a structure. Hack mechanisms are the weapons used to attack those weak points. Their goal is to insert malware into the website. They are bots or programs that target weak points in specific ways to achieve their goal. There are several hack mechanisms, especially since hackers are getting smarter every day about circumventing the security systems of websites.
Types of malwareThe malware types we have listed appear to mirror symptoms closely. That’s because most malware has been named for the symptoms that each display. If you were to drill down into the malware, they aren’t all that different in construction or purpose. All malware is out to use your website in some way or the other: use up its resources, steal data, piggyback on your SEO rankings, etc. The most commonly seen malware are:
Examples of hack scripts, we’ve found in websites: It is difficult to protect against all the hack mechanisms, which is why installing a security plugin is very critical. MalCare’s sophisticated algorithm combats malware effectively, in addition to protecting websites against hack mechanisms. What are the consequences of a hacked WordPress site?The impact of a hacked WordPress website can be wide-ranging in bad consequences. The importance of web security cannot be sufficiently overestimated because of this reason. Website admins without exposure to cybersecurity may read about the occasional hack, but the full potential impact is not always evident. Therefore, it is critical to understand the impact in its entirety. The poor consequences are not confined to individual websites or their owners and administrators but have far-reaching implications. Immediate impact on your websiteIf your WordPress website is hacked, there are chances you won’t even realise it for a while. Rest assured, whether or not you can see a hack, the damage is unfolding and getting worse as time wears on. Let’s say one of the ways the hack manifests is through malvertising; a very common sign with spammy ads or pages that redirect your website visitors to another website (usually a pharma site or one peddling illegal stuff). This has several implications:
Business impactThe impact of the previous section applies to all websites, large and small. The consequences are worse if your website is central to your business. Because then we are talking straight up the monetary loss.
Dangerous for peopleSocial engineering attacks, like phishing, have compounded impact. They are bad for the website and website admin being attacked, but also have terrible consequences for their users and visitors. Credentials can be used to hack into other websites. Hackers can use aggregated information from websites to create personal profiles that can be used to hack into bank accounts and other restricted areas. People also tend to use the same passwords in multiple places, making them especially vulnerable in these situations. While all data theft is bad, it takes a tragic turn with the theft and release of information of vulnerable people, like those in witness protection programs or on the run from abusers. This information sells on the dark web, a particularly ugly place. Why do WordPress websites get hacked?All websites have value, whether large or small, business or personal. Many website owners of small blogs often have a false sense of security because they feel their website is “too small” to be hacked. This is not true at all. While bigger websites will have a bigger payoff for hackers in terms of data theft for instance, smaller sites have value of their own. They can be used as a part of a botnet, for example. Or a site may have a small, dedicated following, which can be tapped for phishing scams via their email addresses. Because people tend to use the same passwords for different accounts, it is theoretically possible to now hack into another site or system using this information. The small website played a small but crucial role in this chain of events. Finally, hacking is always worth the effort. Hacks are rarely carried out manually. Malware, bots specifically, are designed to automate the hacking process. So there is minimal “effort” on the hacker’s front. Thus the gains of hacking your site are disproportionately stacked on the side of hackers. ConclusionIn order to protect your website, it is important to be well-informed about WordPress security and hacks. In this article, we have attempted to explain WordPress hacks, motivations, impact, and much more, so you can make an informed decision about your website’s security. We recommend MalCare to fix hacked WordPress website because it is a complete security solution, and is only getting better with time. We protect 1000s of websites daily, with our advanced firewall, scanning and cleaning algorithm, and much more. MalCare has found malware that most other scanners miss, and has saved our customers untold amounts in revenue. We would love to hear from you. Reach out to us via email for any questions, and we’re happy to help. FAQsHow do WordPress sites get hacked? Primarily, WordPress websites get hacked or keep getting hacked because of vulnerabilities in the core WordPress files, plugins, or themes. Hackers exploit these vulnerabilities to insert malware into the website. The second biggest reason that websites get hacked is because of poor or insecure passwords. My WordPress site has been hacked, what to do? If your WordPress site is seriously compromised, there are steps you can take to fix the hack:
Karishma was an engineer in a former life, and so she specialises in making tech more accessible through communication. When she isn't writing, Karishma spends her time tinkering in the innards of WordPress websites What steps you would take if a WordPress site is hacked?Here's a recap of the steps you need to take if your site is hacked:. Reset passwords.. Update plugins and themes.. Remove users that shouldn't be there.. Remove unwanted files.. Clean out your sitemap.. Reinstall plugins and themes, and WordPress core.. Clean out your database if necessary.. What happens if my website is hacked?When your website gets hacked, hackers often have injected malicious code or files into your website. This adds additional data to your website servers and overwhelms them, which can lead to your website loading slower than before.
Is WordPress website hackable?First, it is not just WordPress. All websites on the internet are vulnerable to hacking attempts. The reason that WordPress websites are a common target is that WordPress is the world's most popular website builder. It powers over 43% of all websites, meaning hundreds of millions of websites across the globe.
Why has my website been hacked?Website Hacking Isn't A Mystery
Weak passwords. Phishing and malware insertion on your computer. Outdated software is a possible, vulnerable area of your website. Another hacked website with the same shared server you use.
|