ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How to remove a Word Press virus

Updated on June 4, 2009

Word Press

How I came to noticemy Word Press site had the virus

I've been creating my own websites for years - ever since I was young and had a fascination with a certain boy band. Now I've grown up and moved on from such interests, although I still enjoy creating my own websites.

Currently I'm using Word Press on my website, as it seems to be quite powerful. However, because of this, I feel as though much of my site is beyond my control. I realized just how little control I had over what was happening on my site when it became infected with a virus. While at work using Lotus Notes, I could see some weird location was being loaded through my site - something similar to pornovanal.ru/module/tracking/..... etc (DON'T try to follow that). I *know* there should never be anything like that being loaded from my site.

My second clue came when my virus scanner poped up after loading my site with an altert saying that FireFox has a thread - JS Downloader.Agent.

So - follow me in my efforts to remove this virus.

A word of warning - I am a beginner to this - however, as there seems to be very little help online, especially in simplistic terms, I thought others would find it useful, and even just understanding how Word Press works will make things easier. Read it, think about it, read other peoples ideas, and decide the best method for you.

First Things First - back up your database

I was a bit naive with Word Press. I'm used to everything being stored in html files, and these days in php files. However, Word Press uses a database, so all your posts and comments are stored in this database. You cannot simply download your word press directory and consider that an adequate backup.

You need to log into your database (phpMyAdmin) and continue by using the directions to back it up. This does not back up your word press website, but it will back up all you posts and comments. It's a start at least.

Word Press has already created these instructions, so follow them here.

With the new Word Press 2.7, there is an easy Export option under Tools, which would also be worth carrying out. I haven't yet tested how it differs from the database backup, but it's worth doing and may be useful to have two separate backup strategies.

Now what?

I don't have the abilities to search through pages of code and pull out the malicious code. I'm new to php coding, and this just wasn't an option for me.

However, as all your main content is stored in your database, you can update or replace your entire word press files without losing your content. You will also have to update your theme with fresh, clean files as well. You may loose some of your personal formatting and tweaking, unless you have a clean version of your tweaked theme and files on your hard drive.

This is where I found one of the tricks to this virus. This virus created a new user on my database, and changed my wp-config.php file so to log into my database using this new user id and password. I knew I would never create a password such as a987g678sdf876s.

So - from there I logged into phpMyAdmin, and removed this new user. However, you must also change our wp-config.php file to have your normal username and password in it, not the changed/hacked username and password.

  • Log into phpMyAdmin
  • Select your blog database from the left hand drop down menu
  • Click on the privileges tab
  • Look for an unrecognized/suspicious user, which matches your wp-config.php login (one that you never created)
  • Click the 'Edit priveledges' image for this user, remove all options
  • Edit your wp-config.php file and return your original login and password in the required spaces

Database Privileges

Find the privileges tab
Find the privileges tab

Uploading a clean Word Press and Theme

Now you have your database backed up - your content (posts, pages), and comments are safe.

What to do? You can upload all your Word Press files again. As I said - these folders don't contain your content - however the folder /wp_content/ does contain your themes and plugins, so you may want to leave this folder until last.

Test your sight after you have uploaded the other folders - if the virus is still there, deactivate all your plugins, and upload your fresh, clean /wp_content/ folder.

Virus removed? Sucess! Still there? Read on.

A virus can also be hiding in your plugins or in you theme files. Next I would recommend uploaded a fresh clean version of your theme. If this doesn't solve the problem, try uploading fresh versions of your plug ins.

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)