DonDominio

WordPress: How to remove malware

WordPress is one of the most used CMS to create websites and blogs because it is easy to use and adaptable to almost any kind of website. For this reason there are constantly malicious parties searching vulnerabilities, that vulnerabilities may appear when we use an old WordPress/plugin/theme version that is publicly known that it doesn't have fixed a vulnerability or by the use of a plugin/theme premium downloaded from a unofficial source. This vulnerabilities are used later by hackers to do phishing attacks (redirecting the visitors to fake bank websites, for example), or even use the website to infect other sites, etc.

In this guide we’ll explain you how to remove malware from WordPress.

Next steps will be useful most times to remove the malware from your WordPress installation, but some malware infections may require additional actions to be solved.

Step 1. Check your computer

Your WordPress may be infected by many causes such as a WordPress vulnerability, an outdated theme or plugin, etc. but also it can be because someone get your WordPress or FTP access password due to an infection of one of your computers or devices.

The first step is to check the computers from where you access to your WordPress using an antivirus or antimalware.

Step 2. Change the FTP password

Now your computer is secure and you can proceed to change your FTP password. You can change the FTP password following this guide.

When you create the new password be sure you’re not using a repeated o insecure password. There exists some tools that can help you to create secure passwords, for example LastPass.

Step 3. Download the latest WordPress version

Each WordPress update bring you a more secure tool, where some bugs and vulnerabilities are fixed. It’s really important maintain your WordPress updated always at the latest available version. As we want use it, we will download it from the WordPress official page. A compressed file will be downloaded, you will have to uncompress the folder to see the WordPress files.

Once downloaded and uncompressed you will let this on stand by for now.

Step 4. Clean the infection

You have to connect to your hosting via FTP. You can use the WebFTP tool available into FTP Accounts into your hosting management area or use an external FTP client as: Filezilla, cuteFTP, etc.

After accessing through FTP you have to move into your WordPress folder. By default our hosting install WordPress into the /public/ folder, if you’ve not changed it or installed it into a subdomain or subfolder you’ll find it there.

You’ll find a list of files and folders like this:

WordPress files & folders, ftp

Delete all files and folders EXCEPT the “wp-config.php” file and the “wp-content” folder.

Now you have to open (edit) the wp-config.php file to be sure it’s not infected by malware. You can find the Edit option by right-clicking the file:

FTP file edit menu

After clicking Edit you’ll see the source code so be careful to not do any accidental change or it may be broken.

We recommend you to compare your wp-config.php with the wp-config-sample.php downloaded before from the WordPress official page. If your wp-config.php is infected you’ll probably find a large character chain which won't appear in the wp-config-sample.php file.

With the wp-config.php file checked and cleaned it’s time to check the wp-content folder. Enter it and open the “plugins” folder, make a list of the plugins you’re using and then delete them.

After that do the same with the folder themes.

Finally check if the folder ”uploads has any executable files inside, should you find anyone check the source code and if it contains malware, remove it.

Step 5. Upload WordPress

You have to upload via FTP the Wordpress files and folders that you have downloaded before (step 2), you can do it following this guide. Remember to install the plugins and themes you have deleted.

After the WordPress restoration change your passwords.

Step 6. Remove the Google warning

The last step is to request Google to remove their warning page (if it appears). In order to do that request you have to login a Google Search Console, add your website and click on Security problems. Now follow Google's steps to proceed with the delist request.

Frequent Questions

Why DonDominio?

At DonDominio, we offer you over 20 years of experience in the domain registration, hosting, email, and SSL certificates sector.

We have specialized technical support and advanced tools for businesses, agencies, and resellers.

Additionally, we have multiple layers of security, continuous monitoring, redundancy systems, and proprietary technology designed to ensure the availability, integrity, and protection of data.

How do I know if a domain is available?

You can find out if a domain is available through a search in our search engine.

How can I register a domain with DonDominio?

Registering a domain at DonDominio is a simple process. Enter the name you want in our search engine to check if it is available, select the appropriate extension, complete the registration, and make the payment.

If you are not sure about the name you want to register, but have an idea in mind, you can activate the AI search in our search engine. In seconds it will provide you with various name options that fit your project.

Once registered, the domain will be linked to your account, and you can use it for a website, email, or any digital project.

How can I create my website?

Steps to create your project at DonDominio:

  1. Search and register a domain for your project.
  2. Create your website and email accounts with our hosting plans.
  3. Protect your project by adding an SSL certificate.
Do you offer specialized technical support?

We have a specialized technical support department with over 20 years of experience in resolving technical issues. All our support agents are real people; we do not use chatbots or AI agents to handle inquiries.

Do I have any benefits as a DonDominio client?

As a DonDominio client, you will have access to special discounts based on the volume of domains you manage.
For more information about this type of discount, check the volume discounts section.

Additionally, you have at your disposal our reseller services which include: developer API, white label panel, and compatibility with WHMCS.

Start your website today

Buy your ideal domain and start your project with a few clicks

Search my domain