Home » Malware Analysis » Removing Malware from your wordpress database

Removing Malware from your wordpress database

I come across a site every once in a while where the malware isn’t actually in the files – but in the database. I would say this type of occurrence happens in about 1 out of every 100 sites I see. Here is a very easy way to clean it out if it’s been placed throughout your site. This example uses the wp_post table, and removes a malicious javascript that get’s loaded in random posts. You will need access to phpMyAdmin and have a basic understanding of mySQL/SQL to do this. It’s 1 line:


UPDATE wp_posts SET post_content=REPLACE(post_content,'mymalicious.js','');

Simply replace the ‘mymalicious.js’ with whatever it is you have found in your database that needs removed.