WordPress Theme Hacked? Scan and Clean Infected Theme Successfully


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.

WordPress theme hacked fixing guide

Are you here because your website is acting up? Maybe it is too slow or you can see that your social media is performing well but site visits are still low. Or maybe you have been locked out of your own website because of malware. Or the worst has happened, and your website has crashed entirely.

In any case, it sounds like you are dealing with a WordPress theme hack. Scan your site immediately to detect malware hidden in your site’s theme files.

A good 11% of the attacks on WordPress websites are caused by vulnerable themes. And if you are a website owner or administrator, ignoring this glaring security concern can turn into a massive headache.

Attackers can exploit vulnerabilities in your WordPress theme to take over your website, expose your database, redirect your traffic, or even shut you out of your own website.

Once your website is under attack, restoring it can take time and effort, which can result in loss of visitors and business. So how do you ensure that your WordPress theme is secured both now and into the future?

TL;DR: Malware can hide in WordPress themes, plugins, and even in core files and the database. The only way to protect your site from malware is to install a security plugin like MalCare, which will scan your entire site daily. This way pesky malware and dangerous code can’t hide in your WordPress theme—or anywhere else.

WordPress Theme Hacked: What does it mean?

A WordPress theme is basically a bunch of files that include stylesheets, templates, Javascript, and even images. These files, together, create the unique display of your website and offer a structure to the design and display of any content that you put up on your website.

Is it possible to hack a WordPress theme? Yes. But is it likely? Also, yes. 

A WordPress theme is an integral part of the website because it dictates how it looks. So website owners are often keen on trying out new themes to update the look of the website.

There are several free WordPress themes out there, along with nulled premium themes that are available on almost every torrent website. So most people try to save on the cost of these themes by opting for the less secure options.

Now, you may not realize that, like any other file, a theme can also be corrupted or infused with malicious elements. So the themes downloaded from untrusted sources can have malicious links or IPs that allow attackers on the internet to exploit the vulnerability of the theme and hack your website.

What are the Symptoms of a Hacked WordPress Theme?

A WordPress theme hack usually leads to symptoms like redirects or site defacement, which is not only embarrassing but a huge security concern. But sometimes, the symptoms are less obvious and difficult to identify. So how do you know if your WordPress theme is hacked?

There are various ways to identify a WordPress theme hack, but some signs are a lot more evident than others. Signs like Google warning messages and WordPress screen of death are obvious signs of malware on your website.

But if you want accurate results and a detailed understanding of what portion of your WordPress website has been hacked, only a thorough scan can help

There are a few indicators that you should know of in order to identify a WordPress theme hack. But more importantly, you should know how much of a security concern a theme hack can be. If you find your WordPress themes hacked, you can experience serious, unpleasant consequences.

Website crash

A WordPress theme hack can be stressful because it can crash your website almost instantly. This directly affects your traffic and digital presence. This is a common symptom of a WordPress theme hack, and updates can be a major reason for the theme hack.

One of the most common concerns that we hear from our customers is that they are wary of updates because it might break their website. This concern is not unfounded. If a theme update is vulnerable, it can cause your website to crash. Also, frequent theme updates or using themes from untrusted sources can also cause a website crash.

The good news is that there is a workaround to this. Taking backups before an update secures the stable version of your website and allows you to restore it in case anything goes wrong. Alternatively, using a staging server allows you to test all the updates before you deploy them on your WordPress site.

Extended loading time

You already know the cost of a slow-loading website. Nobody has the attention or patience to waste on a website that takes forever to load. If your website is one of those, you will undoubtedly lose customers over a slow-loading website. 

A WordPress theme hack is a common hack that leads to hackers using your website as a warehouse for malware, pirated content, and a whole host of other files. This can overwhelm your website resources and affect the load time adversely.

If you think that’s the end of it, you’re in for a surprise. Slow websites do not perform well on search engines and may often change or delete your files which in turn triggers a ‘Page Not Found’ error. This is nothing short of an SEO horror tale and can affect your website’s traffic in a big way.

Website defacement

Website defacement is no joke, it tampers with your credibility, brand identity, and data. As a theme hack grants access to your website display directly to the hackers, they can choose to change the appearance anyhow. Many hacking groups choose to change the home page and leave a message—cue Mr. Robot.

In other cases, hackers can place ads on your website or steal your private information. No matter what kind of defacement occurs, it affects your credibility and business.

Unauthorized redirects

Unauthorized redirects, or what is commonly known as malicious redirects, can be a symptom of the WordPress theme hack. These redirects take all or a part of your visitors to an entirely different web page, which is often an illegal product website or profane content. This is a well-known hack that boosts the traffic of a certain website by redirecting it from another source.

Redirects are bad by themselves, but they also increase the bounce rate of your website and hamper your SEO efforts.

Website blacklisting

When your website is infected with malware, it is flagged as unsecured by search engines, especially Google. Google blacklists over 10,000 websites every single day. And malware is one of the leading causes of blacklisting. But it gets worse, other search engines, web hosts, and browsers also refer to the Google blacklist and your website can end up being flagged on all of them. This will cause your website to not show up in the search results at all. 

The WordPress theme hack will eventually hamper your organic traffic in one way or the other. It is best to stay ahead of the curve and prevent the hacks from occurring at all.

Web host alerts

You share your web host’s servers with hundreds of other sites. Therefore, your web host has a vested interest in making sure that there is no malware on their servers. Web hosts periodically scan the sites on their servers for malware. If they detect malware, they will usually send an email alert to inform you of it. Keep an eye out for these alerts, because if you ignore them, your web host could suspend your account.

User roles

If you notice certain users suddenly getting more privileges than earlier, like an editor getting the admin role, this could be a sign of a hack. Hackers gain access to your website and then escalate user privileges to gain admin access.

Website Analytics

If you notice a sudden spike in your traffic from certain regions or if your website analytics does not tally with your server usage, this could be a sign of malware. Sudden spikes may seem like a good thing, but traffic without cause could be bot traffic attacking your website.

Visitor feedback

Finally, pay attention to your website visitors and their feedback. Hacks can be designed to ensure that the admin does not see any symptoms of the hack. However, your visitors can still notice these symptoms like Japanese keyword spam in SERP results. So take all visitor feedback very seriously.

How to Scan and Clean the WordPress Theme Hack?

Scanning your WordPress theme is an effortless task if you use a plugin. There are several WordPress security plugins that will scan your entire website for malware and clean it up as well. But just like there is a quality gap between free and premium themes, the same applies to security plugins.

Website security is not the place to save costs. And investing in the right security solution can help you stay on top of any vulnerabilities that your website may have. So choose a complete security solution like MalCare to scan your website and protect it with active defenses against future attacks.

And if you are someone who needs to look at all the available options, you can refer to this list of the best WordPress security plugins.

Security plugins are built by experts after months of research, programming, and testing. Therefore, not only is it a faster way to scan your website, but it is also almost always more thorough and efficient. Your installed plugin will auto-scan your website and notify you if there are any security concerns.

You can look for the plugins in the WordPress repository and download the one you like best. Once downloaded, all you do is install the plugin, and it will be ready to go. 

Scanning WordPress theme hack using MalCare WordPress malware scanner
MalCare Scan

MalCare’s WordPress Malware Scanner will alert you of hacks and vulnerabilities like shown in the image. A great thing about this plugin is that the scan runs on its own servers.

This means that your website does not experience any downtime or speed-related issues while the scan is taking place. The plugin also scans both the files and the database tables, so it is extremely unlikely to miss a hack.

If you find your WordPress theme hacked, you want to make sure that the website is cleaned up at the earliest. But there is no need to panic.

Most security plugins also offer the option to conduct a clean-up promptly. This is a premium function in MalCare, as it ensures a thorough and quick clean-up of your website theme.

If you were to do the same manually, you would have to delete the theme and reupload it, which may cause a lot of disruption and take up a lot of time.

Clean your WordPress Theme with a Plugin

The timeline of cleanup through a plugin can range from a few minutes to a few days. Some plugins employ security experts who thoroughly assess your website and clean it up themselves. However, this approach takes a long time, and most website owners with a hacked WordPress theme do not have time to spare

MalCare is the only plugin that allows you to conduct an auto-clean yourself. The algorithm is designed to sweep your entire website and clean it up in a matter of minutes. All you need to do is press the ‘Auto-clean’ button, and the plugin will take care of the rest for you.

Cleaning hacked WordPress theme using MalCare auto-clean feature
MalCare Auto-Clean

More importantly, the intelligent algorithm employed by MalCare does not delete anything that isn’t malware for sure. In case of doubts, the plugin notifies you, and the MalCare team works with you to identify files and clean up the malware.

Scan and Clean Hacked WordPress Theme Manually

If for some reason, you feel the need to scan and clean a WordPress theme hack by yourself, you can follow the instructions given below. However, manual scans can be time-consuming and tricky. If you aren’t an expert, we highly recommend against doing this manually.

In order to manually scan and clean your website, you will have to access the backend of your website and assess all the files manually. 

1. Take a backup of your website

Start by taking a backup of your WordPress site. Cleaning up a theme hack manually can break your website. In that case, a backup can act as a failsafe and help you restore your website. Even if your website is hacked, it’s still better than having to build it from scratch all over again.

2. Download clean installs of WordPress themes

The most common way to scan your website is to identify unknown files and folders in the backend system. Any files that are not a part of the original theme can be malware. To identify malware, you will have to compare the files with that of the WordPress theme in the WordPress repository. Here’s how you can do that.

  • Note all the themes on your website, both active and inactive.
  • Download the exact version of the noted themes from the WordPress repository.

3. Clean theme folders

Once you have a reference for the theme files, you can start comparing the files and start the cleanup process. Follow these steps to carefully clean up your website.

Step 1: Log in to your web host account and view the files on your website. Filezilla is a handy tool to do this.

Step 2: Go to public_html > wp-content > themes

Manual cleaning of malware in WordPress theme files through Filezilla

Step 3: Open the themes you downloaded from the repository in Filezilla and compare them with the ones on your website.

Step 4: If you notice any extra files, it’s probably malware.

Step 5: Delete all the unknown files and folders from your website. 

Caution: If the unknown files are not a part of the hack, deleting files could cause your website to break.

4. Remove backdoors from your site

Another easy way to scan and clean your website manually is to search for common malicious PHP functions. These functions often act as backdoors, which can be exploited by hackers to attack your site. Functions like ‘base64’, ‘eval’, ‘stripslashes’, and ‘move_uploaded_file’ can often indicate infected files. 

However, these functions are sometimes used as a part of custom themes and code, and deleting them could cause the theme to stop functioning.

5. Reupload clean themes

Now that you have cleaned up the theme files, you will have to reupload these files to your WordPress site. The easiest way to do this is to delete the existing theme files and then upload the cleaned files with Filezilla. This process is very similar to that of manually restoring a backup.

6. Look into recently modified files

You can use the File Manager or Filezilla to check the recently modified files on your website. If you notice any files that have been modified recently without you making any changes to them, the modification may be due to malware. Malware modifies the files on your website, and it is a good way to identify malware.

This method, while easy, is not entirely accurate. Because hackers can change the timestamps on the files so that they aren’t easy to locate.

7. Clear the cache

Cache is a copy of your website that lets users load your website faster. However, if your website is hacked, the cached version of it will also carry malware. Therefore, in order to completely get rid of malware from your website, you will have to clear all the cache from your website.

8. Verify that the theme is functioning

The cleaning is done! But because manual cleaning runs the risk of errors, you need to verify if the cleaned themes still function. You can do this by deactivating all the themes on your site, and then activating each theme one by one, while testing if it works as usual.

9. Confirm with a security scanner

Once you are done cleaning your WordPress site, you want to know that you have done a thorough job. Use a security scanner to confirm that your website is malware-free and that the issue is entirely behind you.

If you still detect malware, you may need to get a security plugin or expert help to clean up your WordPress theme hack entirely.

How to Prevent a WordPress Theme Hack in the Future?

There are three major steps to preventing WordPress theme hacks in the future. It is essential to follow best practices in terms of security. But some core vulnerabilities need to be removed to ensure that your site is safe.

Invest in security

The first step to take is, of course, investing in pre-emptive security. You don’t need to worry about hacks if hackers can’t get at your code. Set up powerful firewalls with extensive security protocols, such as installing SSL and using HTTPS on your website.

Use and monitor activity logs to make sure that unauthorized activity is seen and caught as soon as possible. Finally, conduct security audits on a regular basis.

By keeping an eye on any potential vulnerabilities, you will be able to head off hackers before they can attack your site. While it may seem like a lot of work, a powerful plugin can do this on a regular basis without you having to overlook the security. You can install MalCare on your website in a matter of minutes.

Use trusted themes

The next step is to make sure that there are no backdoors to your website. Backdoors often come pre-installed if you pirate your WordPress theme. So make sure to buy your WordPress themes from a reputable vendor.

Another point of vulnerability could be a lack of updates. Updating your website regularly can be time-consuming, but updates are essential. Whenever a vulnerability is found, it is patched and made public through an update.

Even the weakest hackers can get through the unpatched security hole if the patch is not downloaded and installed. Having nulled themes can cause similar problems since they do not get updated and thus cannot be patched.

Train your team

The third step is to make sure that no hacker can use social engineering methods to get in. By training employees on the backend, you can rest assured that attacks like calls asking for passwords (yes, this has worked) or phishing don’t work.

Employing proper training will reduce the chances of in-person hacks as well. Implementing security policies, developing a culture of security, and training will make your site almost impossible to hack!


If you find this WordPress theme hacked guide useful, share it with your team, friends, or colleagues who may need it. Not many people realize how important it is to secure your WordPress theme. And bringing this to others’ attention will definitely get you some brownie points!

Install a plugin to overlook your website security, and learn more about how hackers can attack your website. We recommend starting with this article on brute force attacks

And lastly, pat yourself on the back for upgrading your site security. You deserve it!


Can a WordPress theme get hacked?

Yes, if you download a WordPress theme from an untrusted source or use a free or nulled theme, it can get hacked.

How do I know if my website theme is hacked?

A WordPress theme hack can cause various symptoms such as unauthorized redirects, website defacement, or slow-loading web pages. But the best way to confirm is by scanning your website.

Why should I avoid nulled themes?

Nulled themes often carry malicious code or malware that can grant attackers access to your website. It is best to use themes from trusted sources.

Can I clean the malware on my website myself?

Yes. However, if you are not an expert, you might break the website. We highly recommend using a security plugin to clean your website.

Why do I need a security plugin?

Security plugins are developed by experts after a lot of R&D. Plugins can do a more thorough and faster job than cleaning up your website manually.


You may also like

dns hijacking
DNS Hijacking: All You Need to Know About It

Have you ever typed a familiar URL into your browser only to land on a strange, unfamiliar website? Imagine your visitors facing the same dilemma when accessing your website. They…

How to Protect Your Website from Hackers
How to Protect Your Website from Hackers

Every day, small businesses become victims of cyber attacks. Hackers break into websites, steal customer data, and damage reputations. Your website, which is vital for your business, is at risk…

What are Website Backdoors and How to Clean Them?
What are Website Backdoors and How to Clean Them?

Are you frustrated with your website getting hacked again and again, even after you’ve cleaned it each time? You’ve spent hours fixing your site, only to find that the problem…

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.