How to Remove Malware from your WordPress Site

Recently my blog, this blog actually, was hacked by some Adultbiz guy and I got a blocked status from Google. It was very frustrating to see my site locked up from being opening to users. However my site was still appearing on Google results but it was not opening directly as it is opening now.

I tried many plugins available for free from WordPress community. Some of them never tracked any malware, some of them scanned it out but asked for paid solutions to remove this malware tag from my website. I got even more frustrated!

Now being a web designer, I decided to manually remove this malware. This was simpler than I ever thought! If you are facing the same situation, just follow these steps to get rid of this trojan. Remember to take a full backup of your WordPress before trying anything out manually!

  • Get into your admin dashboard and navigate to ‘Appearance -> Editor’
  • From the right hand menu, under ‘Templates’, click on ‘Header (header.php)’.
  • Delete everything between these two lines:
    <?php wp_head(); ?>

  • Now it should look like this:
    <?php wp_head(); ?>
  • Click on ‘Update File’ at the bottom of the page.
  • From the right hand menu, under ‘Templates’, click on ‘Footer (footer.php)’.
  • Identify and Delete same lines as you did from the Header.php.
  • Bravo! Your site has been cleaned!
  • Now you can login into your webmaster area at Google and tell Google to validate your website.

That solved my problem, I hope it will solve yours as well. Have happy blogging!

One thought on “How to Remove Malware from your WordPress Site

Leave a Reply

Your email address will not be published. Required fields are marked *