WordPress Security is an important factor today as WordPress is used for excellent blogs,corporate website,online shop. MySQL, .htaccess and plugins can harden. It is not our fist post on WordPress Security, you can read this and this article on WordPress Security; but this article is sufficient alone for WordPress Security.
External factors for WordPress Security
The external factors regarding WordPress Security are :
- Your own computer, especially Windows PC should be free from malware and virus. We recommend to use UNIX or UNIX like operating system to access WordPress (S)FTP , run commands through CLI , working on PHPMyAdmin etc. It is not that, using a Mac or Linux PC will make you 100% safe, you must check your computer with an / multiple up to date security softwares.
- Never use weak or easy to guess username and password
- Avoid using Shared Hosting. It is better to use VPS with root access from very well known web hosts like The Rackspace Cloud, Media Template or Amazon. Obviously a managed Hosting is superior.
- Never use Free CDN. Use a paid Content Delivery Network.
- Never use a Theme, Plugin from questionable source. Questionable source includes craked or nulled Themes and Plugins. The reason is, these can have embedded scripts itself enough to breech WordPress Security, additionally the reverse engineering process can itself render it a dangerous plugin.
- It is better to rename the original theme’s name – both of folder and stylesheet. This gives an extra edge for WordPress Security, as hacker will take time to understand the theme’s structure.
- Remove unnecessary HTML comments from your WordPress Source code – again its an extra edge for WordPress Security as Hacker will have less knowledge about the plugins to attack.
- More the uptime of a Server, more enhanced is the WordPress Security. The reason is – if PHP does not run, Apache modules are off – the php files can be opened on browser like plain text files !
- It is obvious that uptime and non-failure of server plays a big role on WordPress Security. Load Balancers with Cloud Hosting enhances WordPress Security.
- Use a reliable backup service for nightly backup.
Master Core Tricks for WordPress Security

These tricks for WordPress Security must be used all, using one trick of WordPress Security will keep the door open through other way.
---
Hardening WordPress itself
Regularly update WordPress. Never use nightly builds for production website. Use a secured VPN to login, if possible use SSL to login. Do not use API based login Plugins (Twitter, FaceBook integrated login systems).
Via .htaccess enhance WordPress Security
For those who are using Apache server, .htaccess is the most powerful tool to prevent access. Apart from root, all subfolders (wp-admin, wp-content and custom folders) must have own .htaccess. This is an example .htaccess (for root) to enhance Wordpress Security :
# This will prevent browsing of readme file as it gives links
<files readme.html>
order allow,deny
deny from all
</files># This will prevent editing htacess itself
<Files .htaccess>
order allow,deny
deny from all
</Files># This is very important for WordPress Security to prevent viewing of install file
<files install.php>
order allow,deny
deny from all
</files># This is most important for WordPress Security as wp-config.php will open like a text file if Apache, PHP are not running
<files wp-config.php>
order allow,deny
deny from all
</files>
WordPress Security via Plugins
Several plugins like WP Security Scan plugin, WP Better Security, Bullet Proof Security, Plugins to Limit the number of Login attempts are great.
PHP modifications for enhancing Wordpress Security
search.php , timthumb.php files are very important for WordPress Security as they has vulnerability. Please look at the older linked articles at the beginning of this article if you are interested. These gives an extra edge for WordPress Security. Further more, a naughty trick for WordPress Security is to rename wp-login.php file when you are not using it. Change security salt keys of wp-config.php every Sunday (to remember routine weekly work for WordPress Security).
MySQL / PHPMyAdmin for WordPress Security
MySQL. This is very important area for WordPress Security. Those who are using Cloud Database, like of Rackspace Cloud, must keep two or three synchronized live MySQL database of different database server. This will work as live backup.
The most important point about WordPress Security through MySQL is to :
- Delete repentant tables of deleted plugins.
- Optimize Database
- Delete the default WordPress user account and create one and only user with Admin privilege. The order must not be #1
- Regularly check MySQL for appearance of any suspicious new table (compare with your control installation).
WordPress Security via Dashboard
Never keep the option open to register through WordPress !
WordPress Security even if hacked
Hacking, virus, malwares are a vicious cycle like channel.
In case you are hacked and need someone for paid help to get it back, never hire an unknown person through WordPress job. Hire well known WordPress developers who has good blog.
