An ounce of prevention is worth a pound of cure.
If you want to prevent any of your Wordpress blogs from getting hacked make sure you keep your software up to date, and follow other basic Wordpress protection strategies, like - securing your admin folder, removing the Wordpress version number from your theme's header.php file, creating an index.html file in your plug-ins directory, and removing other common Wordpress oriented footprints like a "powered by Wordpress" signature in the page footer.
Get an Early Warning
Another thing you can do to protect yourself is to get an early warning if/when your blog does get hacked. You can subscribe to a Google Alert for site:yoursite.com viagra OR cialis OR levitra, and so on...as Patrick explains on Blogstorm.
If one of your blogs gets hacked fix the others before it is too late. Some plug ins make it easy to update/re-install Wordpress.
Stopping Comment Spam
Other easy suggestions on this front are to require a captcha and force first time comments to be moderated before appearing on the site.
Google IP Address Targeted Hacking + Cloaked Spam
One of my blogs was recently targeted by a blog hacker that inserted links into the site that could *only be viewed by GoogleBot*. You typically would not notice such a hack unless you subscribed to a Google Alert for your site, saw yourself ranking for some of the spam terms, and/or when your Google Search Traffic started to fall.
The issue with such a hack is that it is hard to know if you wiped it out, even if you update everything. When you use Firefox's User Agent Switcher you still will not see the links because you are not surfing from one of GoogleBot's IP addresses.
In fact, for this particular hack you can't even see the links on Google's cached version of a page unless you view the text cache version of the page.
Once you click the text only cache link tons of pharmacy links appear in the page footer. This screenshot was taken from a Texas Instruments blog post on security and safety
Google currently has indexed over 20,000 pages with this particular hack.
How This Type of Hack Influences Google Traffic
Earlier this week one of my writers who loves blogging complained that search traffic was dropping slightly, and then after a few days of minor decay the search traffic was cut in half. Keep in mind this site gets much of it's traffic from organic links.
Our Google traffic started to fall off slowly, and as more of the pages with spam in them got indexed the fall off became sharper. After a week or so traffic may be a small % of what it was...or if they just spam a couple pages the change in traffic may be so minor that you never notice it. The traffic decay rate depends on...
- the crawl priority of your site (how frequently it gets crawled)
- the number of pages you have on your site
- how bad your site gets spammed (number of spammy links and pages, etc.
You can see what portion of your site got hit by searching Google for "spammy footprint" site:example.com and comparing that count to the total number of pages Google shows indexed for site:example.com.
How to Clean Up Your Wordpress Blog
Regular updates are a plus to make it easy to revert to a prior version if needed. And if you find yourself upgrading software after a hack make sure your server is clean (save old files elsewhere) and install fresh. You probably want to change your database and Wordpress passwords after upgrading, and if you are not sure where the hack was you may also want to change your theme.
There are a lot of different ways people can hack into a Wordpress blog. Some spam hunting ideas include...
Using SSH to look for recently modified files and/or weird new files that were added to your site. Some hackers may also add files to the root of your site, or above it hidden somewhere on your web server.
Some hacks may be via a Wordpress plug-in. If you have inessential plug-ins installed see if others have complained about them getting hacked, and see if you can remove them. I think some hackers that get into Wordpress go so far as adding plug-ins that position spam throughout the blog.
If your database contains spam in it then you can run the following MySQL query (from Michael VanDeMar) to find many of the most common types of Wordpress link hacks.
If you can't find any spam in your Wordpress database, then...
- look for files that have been added or modified
- back up your files and database
- disable plug ins
- delete all files (except for maybe your config file and .htaccess file - and verify those have not been edited as well)
- update your blog to the newest version of Wordpress
- change your MySQL password and your Wordpress password
- install a new theme
- download necessary plug-ins from their original sources if you want to keep using them
- make sure you performed all the steps at the top of this article to try to keep your blog safe.
- if your problem was a shoddy host that got compromised then its a good idea to shift to a better Wordpress hosting solution
If The Hacker Was Using IP Cloaking...
If the hacker was using IP cloaking you can't be 100% certain that the spam is gone until Google tries to index new pages on your site and/or re-indexes old pages that were hacked.
You can find files that have been indexed in the last day or last week by using Google's date based filters.
If you updated your blog a few hours ago you can also do a regular site:www.example.com search on Google and set the results to 100 per page to find any pages that have been re-indexed in the last few hours. Once the search results come up you can search the search results page for hours ago.
One note of caution is to check the actual page's cache date at the top of the page. Sometimes when a cache is really new clicking on the link will show you the new page, but sometimes it will show you a cached page from a few days back. When you see a new cached page without the spam links hopefully your spam problems are almost over and your site is on the road to recovery, with rankings improving as Google caches more pages from your site.
Remember to set up a Google Alert for your site so you can track if any spam links magically re-appear.
I have only had a couple blogs hacked in my many years of blogging. Did I miss any obvious tips and/or wisdom you can add to the above post?
Gain a Competitive Advantage Today
Your top competitors have been investing into their marketing strategy for years.
Now you can know exactly where they rank, pick off their best keywords, and track new opportunities as they emerge.
Explore the ranking profile of your competitors in Google and Bing today using SEMrush.
Enter a competing URL below to quickly gain access to their organic & paid search performance history - for free.
See where they rank & beat them!
- Comprehensive competitive data: research performance across organic search, AdWords, Bing ads, video, display ads, and more.
- Compare Across Channels: use someone's AdWords strategy to drive your SEO growth, or use their SEO strategy to invest in paid search.
- Global footprint: Tracks Google results for 120+ million keywords in many languages across 28 markets
- Historical data: since 2009, before Panda and Penguin existed, so you can look for historical penalties and other potential ranking issues.
- Risk-free: Free trial & low price.