Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Recently my wordpress website has got a lot of spam links. Google has indexed a lot of spam links from my website. The links are like:

http://example.com/viagra-buy.html

I found out that my .htaccess file had been modified and the and a php file with base64 code was added to my server. I want to know how I can remove the spam links from the Google. I'm afraid Google will mark my website as spam. Also how can I prevent this attack in future? Please help.

share|improve this question
Hacked sites are out of our scope. But see Verifying that I have fully removed a WordPress hack? for useful advice. – toscho Jun 4 '12 at 15:47

closed as off topic by Stephen Harris, toscho Jun 4 '12 at 15:45

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

First thing you need to do is clean up your site. It's infected and it needs to be disinfected. After you do that, you need to change your passwords.

Here's some information on how to do that: http://blog.sucuri.net/2011/02/cleaning-up-an-infected-web-site-part-i-wordpress-and-the-pharma-hack.html

Your web host may even already have tools in place to clean up the site, so you can check with them.

After it's all cleaned up:

  1. Make sure no posts or pages were maliciously added (this usually isn't the case.)
  2. Search for something like "[your host name] wordpress hacked" and see if it's a chronic problem with your host. There's a couple hosts out there that aren't configured correctly for WP and the WP sites get hacked no matter what you do.
  3. Keep WordPress updated, all the time.
  4. Try setting up some or all of the typical WordPress hardening measures http://codex.wordpress.org/Hardening_WordPress
  5. Use a security monitoring service like http://www.wordfence.com/
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.