“You’ve been hacked!” Imagine how you will feel when you visit your blog only to find all your previous work has gone and some clown has taken over your site.
An average of at least 100,000 sites are hacked every day since January 2011; those are the ones that were reported, most go unreported. 17 WordPress vulnerabilities appeared in just the first 3 months of 2011 and many thousands of plugins are not continuously monitored nor fixed.
For all its fabulous strengths, there is an equally strong downside to WordPress. Unfortunately, the fact that it is so popular is exactly why it attracts so many hackers and internet evil-doers who seek out WordPress sites for play and prey. And they don’t even scan for vulnerabilities personally; they use automated “bots” that work non-stop looking for holes.
Once they find a hole, they can use that entrance point on many thousands of other sites and yours could be next.
It happened to me several times in a row and I suddenly lost dozens of sites that were on the same server. The loss of sites and subsequent loss of time spurred me to investigate my whole approach to WordPress security and this is what I want to pass on to you.
First of all, you should understand that nothing will work perfectly, after all, hackers break through far stronger defenses than I am about to recommend. The best you can do is – do your best – and make it harder for the junior hackers to cause you harm.
Always have a recent backup so you can quickly replace a hacked site. Make sure you have the latest versions of WordPress and all your plugins because they contain the latest fixes for known holes that the bots are looking for.
Delete those unused themes and plugins you are hoarding. Old and inactive themes are a serious security risk. Either use ftp or your WP admin dashboard and remove them from the wp-content/themes/ directory; just reinstall when you need them.
Do not use public wifi for logging into bank your trusted directory accounts and your sites because there is no security in public. Only install plugins that you can trust because the wrong ones will install a free key to everything you have; be warned.
Delete the automated “admin” user and setup a harder name to crack. Use scrambled passwords that are genuinely random using all kinds of characters from your keyboard. When you set up that new user, give them a nickname that will show to the public – make it different to the username so it is harder to find.
There are many excellent security plugins available but if you install too many plugins your site will load more slowly and that will damage your search engine rankings. I’m just going to give you tips that you will have to do yourself using ftp. If that sounds too hard for your current skill level, then use plugins such as WP-secure, Login Lockdown, Akismet, Chap Secure Login, WP Security Scan which will do many of these things for you.
Create an empty index.html and an empty index.php then upload them into your plugin directory to hide your plugins folder so no one can see what plugins they can exploit there. Upload the same file into your themes folder to hide them too.
Set file permissions to 644 on your wp-admin/index.php and to 600 on wp-config.php so they cannot execute.
Hide your WordPress version so hackers won’t know what version you are running. Go to your theme’s folder and open “header.php”. Delete the line <meta name=”generator” content=”WordPress <?php bloginfo(‘version’);?>” /> – it has no useful purpose.
Replace the automatic wp_ MYSQL table prefix with something more random. If this is too risky for you to do, WP Security Scan plugin will do this for you.
There are other measures you can use to restrict access and the ability for an intruder to find various folders on your server but they will mostly require adding various code elements to you htaccess file and I don’t want to encourage that here. But if you are more adventurous, you can find lots of quality advice on the web.