Malware Attack is getting very common in WordPress lately which could be because WordPress has a wide community of users. Anything that is popular and easy to use will always have its own consequences of using them.
There are numerous types of malware attacks that happen to WordPress website on a regular basis. I would like to write this post to help those who have been googling around on how to prevent malware attacks in their WordPress blog or website.
This current very website have gotten malware attacked multiple times and this post is all about how I came out of the attacks and cleared out the issues and some of the remedy measures that I have taken to prevent the attacks from happening.
Down below are some of the checkpoints that I did after the attack happened.
Step 1 :
If you are a developer like me, the first thing that you would normally do after you start seeing the malware issues in your website is to go to the server and check the modified files without your knowledge. You can further open one of the modified file to see what’s happening.
If you see some unusual string at the start of the php file in any of your WP files, that’s definitely an issue.
Firstly, Reset your WordPress Admin Dashboard Password.
Step 2 :
Next thing to do here is to run a scan on your website. There are multiple WordPress Scanners available online, but I personally prefer Wordfence WordPress plugin to scan throughout the WP files.
You can do a regular scan check using Sucuri Site Check and see if that helps.
Step 3:
Wordfence has the features to replace the WP files that have been attacked with fresh copy of the WordPress files. This will help you to get back to your original version of WordPress before it got attacked.
Step 4 :
If you are not using Wordfence, or any plugin that will help you out remove the attacked files, another best option is to update/ re-install your WordPress Core and the plugin files and the theme files if needed. Backup of the website would be preferred at any point so that you can go back to the version that’s clean.
Step 5 :
Following the above points would mostly remove the malware attack from your website. To prevent this from happening again, you can follow some of the suggestions.
Now let’s come to Prevention.
First things first.
Backup your WordPress server files and database every once in a while. Set up a frequency to take backups of your server files for you to go back to a cleaner version if any issues were to happen.
Set up the proper File Permissions to your website files so that there will be no access to the web user to edit/update the files in your server.
Set up some good Spam Blocker Plugin to block the spam comments.
Disable XML RPC Connection in WordPress which can help you stay away from any attack that happens via xml-rpc.php in your WordPress. This can be done with Wordfence, or using htaccess.
Keep all your Plugins, WordPress Core updated all the time.
These are some of the methods that I have followed to keep my blog stay away from the malware attacks. Let me know in the comments on what worked for you.
Pic Credits : Unsplash -Michael Geiger
1 thought on “How To Remove Malware From WordPress”