wordpress website

How to Clean Up Malware Infections in Your WordPress Website

Jasper AI

Cleaning Up Malware Infections in Your WordPress Website

Small business owners rely heavily on their websites for their online presence. Malicious activities or malware attacks on their website can damage their reputation and make their business untrustworthy. WordPress websites are especially vulnerable to such attacks, and knowing how to handle malware infections can be challenging. However, cleaning up malware infections is essential for maintaining the security of your website and keeping it functional. In this post, we will provide a comprehensive guide on how to clean up malware infections in your WordPress site.

Step 1: How to Detect Malware on Your WordPress Site

The first step to cleaning up malware infections on your WordPress site is to detect the presence of malware. There are several ways to detect malware on your site. One of the easiest ways is to use a malware scanner. A malware scanner will scan your site for malware and identify malicious files. There are several free and paid malware scanners available that you can use to scan your WordPress site. I will give more information on these below.

Another way to detect malware on your WordPress site is to look for unusual behavior. Malware can cause your site to behave unusually, such as redirecting visitors to other sites or displaying pop-up ads. If you notice any unusual behavior on your site, your site may have been infected with malware.

You can also check the access logs on your server to see if there have been any unusual requests to your site. Malware can cause your site to receive unusual requests from specific IP addresses. If you notice any unusual requests, your site may have been infected with malware.

Checking server logs may not be an option for you, but the security plugins we suggest later in this article offer activity logs you can view. The plugins will even alert you to unusual activity.

Step 2: Understanding the Types of Malware Infections on WordPress Sites

Several types of malware infections can affect WordPress sites. The most common malware infections are backdoors, trojans, and phishing scams.

Backdoors are a type of malware that allows hackers to gain access to your site even after you have removed the malware. Backdoors can be challenging to detect because they are often hidden in legitimate files.

Trojans are malware that disguises itself as a legitimate program or file. Trojans can be used to steal sensitive information or gain site access.

Phishing scams are malware that tricks visitors into giving up sensitive information, such as usernames and passwords. Phishing scams can be disguised as legitimate login pages or forms.

(We independently select these products — if you buy from one of our links, we may earn a commission.)

Landing Page: https://be.elementor.com/visit/?bta=65960&nci=5553

Step 3: Backup Your Website

Before proceeding to the cleaning process, you must back up your website to avoid any data loss. You can use plugins like UpdraftPlus, VaultPress, or BackupBuddy to back up your website's content, theme files, and databases. These plugins offer automated backups, and you can back up your website content to the cloud or through a download link.

While backing up your website is vital in cleaning a malware infection, an even wiser practice is running regular backups before an infection occurs. Though a good backup app should check for malware, one might slip through and be included in the backup. Obviously, this would perpetuate the infection.

As a backup tip, a quick fix for a significant website malfunction can be to have two critical files downloaded to your computer for quick access. If you have FTP access to your WordPress installation, download the index.php and wp-config.php files to your computer from the installation's root directory. This can assure a fast recovery if your site goes down entirely due to an infection or other cause.

If you don't have FTP access or don't know how to work with FTP, the hosting panel of your website host may have a file manager. You should be able to find and download those files using the file manager. A third alternative to downloading the two files is to use the WordPress plugin “Filester – File Manager Pro.”

As with many other insights, I learned this insight the hard way through personal experience. As a web developer/designer, I started my day not too long ago with a notice of unusual activity on one of the websites I manage. I went to the website and got nothing except an error message. The whole website was down.

Within a few minutes, I learned I had eight websites down. When a whole website is down, my mind goes to those two essential files: index.php and wp-config.php. Because I had backups of those two files for all my websites. I had all eight websites back up and running within a few minutes. This is not to suggest that every website crash is due to these files, but they are an excellent starting point. And often, as in my case, you will have to go no further to get your site operating again.

I still had an infection problem, but it isn't easy to do anything when you cannot even access the wp-admin dashboard. Once the sites were operational, I could take positive steps to eliminate the infections.

Video Demonstration

View the video below for a demonstration of website malware clean up.

Step 4: Cleaning Up Malware Infections Step By Step

Now let's walk through a step-by-step process to clean up an infection:

1. Isolate affected files: Once you identify the problem, it is necessary to isolate or locate the affected files to prevent further damage. Two free website scanners are:

In addition to these two tools, a WordPress plugin for scanning and security is MalCare WordPress Security Plugin. It is a Malware Scanner, Cleaner, and Security Firewall.

2, Remove malicious files: Once you have identified them, remove the malicious files from your site. You can do this manually by deleting the files or by using a plugin that will remove the files for you. The plugin MalCare will not only identify malware files but will also remove them.

Even after using a plugin to remove harmful files, a personal scan of your files is a good idea. You can do this using one of the three methods mentioned above to access your WordPress installation files. (FTP, dashboard file manager, or WordPress plugin Filester)

As you scan, you will be looking for anything that looks unusual. For instance, the recent infection I referred to above kept dumping files in the root directory of my WordPress installations that looked like this: aeda1d3cbabf291bbd35dd20106509d8. There was no file extension, just this long string of letters and numbers.

If you find an unusual file but aren't sure if you should remove it, rename it. For instance, with this file, you might rename it to “aeda1d3cbabf291bbd35dd20106509d8_ARC”, showing it as an archive file. If you find issues with the website or admin panel after renaming the file, change it back to its original name. No harm, no foul.

When viewed, the files on my sites contained a URL designed to redirect visitors to a porn site. Of interest is that the redirection was only triggered when a visitor clicked on a URL for the website from a Google referrer. If the site URL was entered directly, no redirection took place.

3. Update your site: It's essential to update your site to the latest version of WordPress and all plugins and themes. This will ensure that any vulnerabilities exploited by the malware are patched.

4Change your passwords: Change all passwords associated with your site, including your WordPress login, FTP, and database passwords. This will ensure that the hacker can't regain access to your site.

A word about changing the database password. This can be daunting for the novice user, but WP Reset, a WordPress plugin, will step even the novice through the process.

5Check your site: After cleaning up the malware infection, it's essential to check your site to ensure everything is working correctly.

Step 5: Harden Your Website Security

Once your website is clean, you must harden your website's security to avoid future malware attacks and improve your website security. For this, I recommend the WPMU DEV plugins bundle. The bundle has seven primary plugins, one of which is Defender Pro. Defender Pro monitors your WordPress site's vulnerabilities, detects any malware activity, and removes the villains.

By using all seven plugins, you cover most of your plugin needs while assuring they are compatible with one another and safe against vulnerabilities. And the cost of using all seven pro plugins is less than many individual plugins.

Suppose you choose to use a stand-alone plugin for security while using a variety of other plugins to cover the remaining tasks. This practice can increase your risk of vulnerability to infections.

Read my article, “Why Choose WPMU DEV for Your WordPress Projects?” for more about WPMU DEV plugins.

Additionally, you can implement best practices such as strong passwords, periodic backups, and limited login attempts.


Cleaning up malware infections in your WordPress site is crucial for maintaining your website's security and functionality. You can follow the above steps to identify, remove, and prevent future malware attacks. Remember to back up your website before the cleaning process and update your website's core, theme, and plugins. Lastly, follow the best security practices and use security plugins to harden your website security. By doing so, you can keep your website safe and keep your small business running smoothly.

PHP Code Snippets Powered By : XYZScripts.com