How To Remove Malware From WordPress Print

  • 149

This can be used to remove malware from WordPress. However, you must need to be comfortable with FTP and File Manager. If this is not your cup of tea, you may wish to look at our web development support.

Step 1: Scan Your Computer

Malware can infect your WordPress in many ways, one of them may your computer has a virus that is leaking your FTP password. This is actually quite common. So you need to make sure your computer is virus-free. We recommend scanning your computer with Malware BytesAVG, Norton or Kaspersky 


Step 2: Change Your cPanel/FTP Password

Y
our computer is now virus free, you should change your cPanel and FTP password. Choose a random password with at least 1 special character like ! # < &, a mix of lower and uppercase letters plus numbers. A good example is  
Y^jsd7#jBse.

 

Step 3: Download WordPress

Download fresh WordPress copy from official WordPress site and extract this on your computer.

Step 4: Removing The Malware Infection


Login to your FTP or cPanel > File Manager.

Your WordPress installation files on your web host should look like this:

 

wp-admin
wp-content
wp-includes
index.php
license.txt
readme.html
wp-activate.php
wp-blog-header.php
wp-comments-post.php
wp-config.php
wp-config-sample.php
wp-cron.php
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

 

Delete everything you see there except for the wp-content folder,and the wp-config.php file.

 

Now your installation should look like:

 

wp-content
wp-config.php

 

In your cPanel > File Manager, click and edit the wp-config.php file. Make sure that there is not unusual code, If there is malware in this file, it will generally look like a long string of random text. You can compare it to the wp-config-sample.php file to be sure.

Now go into the wp-content folder. It should look like:

plugins
themes
uploads
index.Php 

Remember plugins you are currently using, then remove the plugins folder and index.php file. You will need to re-install your plugins after the cleaning process.

Go into the themes folder, and remove any theme which you are not using. You will then need to individually check each file in your current theme to make sure there is no malware or strange codes in them. If you have a clean backup of your theme somewhere (like on your computer), then to be safe you should just delete the entire themes folder.

 

Check every directory inside your uploads folder to make sure there are no PHP files or anything that you may not have uploaded.

 

 

Step 5: Re-upload WordPress

 

The fresh WordPress files that you extracted earlier in Step 4 can now be uploaded via FTP. But do not upload wp-content directory and wp-config.Php file as you did not delete them.

 

If you removed your theme you should also re-upload your clean backup theme files.

 

 

Step 6: Change WordPress Admin Password and Re-install Plugins

You should now be able to access your dashboard, and change your admin password. Always use a random or a heart password.

And reinstall fresh plugins you have deleted before.

Step 8: Remove Google Warning

Now that your site is free of malware, you can submit your site to Google to get the warning “This site may harm your computer” removed. Login or create an account at Google Webmaster Tools, add your site, click Health, and then click Malware. and finallyRequest a review.


Was this answer helpful?

« Back