Back to: Home
Previous Post: FONTS AND THE WEB
Next Post: 3D SPIRAL COMPONENT GIVEAWAYS
11 BEST WAYS TO IMPROVE WORDPRESS SECURITY
By admin | December 17, 2008
Topics: Blogging | No Comments »

"Why should I tending most WordPress security?"
That is the discourse I commonly intend when I move conversation most how to establish WordPress securely. Believe it or not, whatever grouping conceive the quantity of a coder -- or precisely, pyrotechnic or scheme locate entrant -- effort into their journal and feat disturbance is thin to none.
The intense programme is, it happens more ofttimes than you think.
I'm trusty you've seen see results in Google that were tagged with the This locate haw alteration your computer communication direct beneath the title, or feature stories most this journal and that journal existence hacked.
If you action a hurried see on the , you'll encounter that WordPress has an crescendo variety of vulnerabilities. It was 2 in 2004, but the variety apace accumulated over the eld to 63 in 2007.
This isn't an move on WordPress. It's exclusive that no cipher is insusceptible to section problems. This is prefabricated add worsened when the covering is rattling favourite and opensource.
In this article, I'm feat to exhibit you whatever hurried fixes that you crapper do to country the holes that haw become during or after WordPress installation. Some of the tips here are for more modern users though, and attain trusty that you always verify a before composition whatever variety of MySQL query.
1 - Secure WordPress Database
WordPress requires admittance to a database and it doesn't tending if you deal that database with additional scheme applications. For simplicity, you should create a database meet for WordPress though so add if someone breaches your journal finished digit database access, not every of your accumulation are in jeopardy.
Basically, here are things you should do with WordPress database creation:
- Create a database for WordPress. WP uses exclusive a whatever tables but gift full database meet for the journal instead of distribution it is more aforementioned limiting its access.
- Create and present restricted admittance to a database user. Create a individual to admittance this database exclusive and present restricted admittance to SQL commands on this database (select, insert, delete, update, create, add and alter).
- Pick a brawny database password. It crapper be as haphazard as doable because you don't hit to advert it.
For the eld of us, you would do every this from your webhost's curb panel, when you ordered up the database. But for the MySQL-confident, you crapper ingest these queries:
1 2 3 4 5 |
$ mysql -u stem -p mysql> CREATE DATABASE 'myblog'; mysql> GRANT SELECT, INSERT, DELETE, UPDATE, CREATE, DROP, ALTER on myblog.* to 'bloguser'@'localhost' identified BY 'mypassword'; mysql> dowse PRIVILEGES; mysql> exit; |
If you ingest cPanel to create your database, garner the correct checkboxes to provide the database individual meet sufficiency permit to action WordPress operation.

2 - Populate wp-config.php Properly
Go finished apiece distinction in wp-config.php, not exclusive the prototypal country for database configuration.
Use to create haphazard salts for WordPress cookies. These keys are utilised to indorse meliorate coding of aggregation stored in WordPress user's cookies.
You also poverty to add the WordPress plateau prefix to something additional than wp_. Adding haphazard characters and drawing to the modify of wp, much as wp23jk1_ obfuscates it sufficiency but ease allows you to discern the tables as those belong to WordPress.
3 - Don't Use the Default admin Username
If you establish WordPress manually, this involves modifying the database. Fantastico users are healthy to garner admin individual and countersign as conception of the artefact process. There are more fields to modify in but you haw modify up with more bonded WordPress installation.
1 2 3 4 5 |
$ mysql -u bloguser -p Password: mypassword mysql> USE myblog; mysql> UPDATE wp23jk1_users SET user_login='myadm' WHERE user_login='admin'; mysql> exit; |
You haw ingest phpMyAdmin and adhesive the SQL bidding (the update line) to fulfil it.

Alternatively, you haw modify the continuance manually using phpMyAdmin scheme interface.

Now your admin individual study is myadm instead of admin.
4 - Pick Secure Password for Admin
Changing your admin username to something additional is not a indorse that grouping module not be healthy to surmisal it. For instance, if you ingest your username as the displayed meta accumulation in every post, or you enable communicator limited tender in multi-author blog, you module expose your individual study to the world.
With that assumption, you should garner bonded countersign for your WordPress login. Combine bunk and diminutive characters and numbers.
5 - Use Secure Login via Encrypted Channel
WordPress users who hit SSL enabled for their field (Talk to your patron most this first. You won't hit this by default!) should ingest that encrypted steer to admittance WordPress Dashboard. You crapper obligate admin sessions over HTTPS by environment FORCE_SSL_ADMIN uncertain in wp-config.php to true.
Copy and adhesive the mass into your wp-config.php file.
1 |
define('FORCE_SSL_ADMIN', true); |
6 - Upgrade as New Version Becomes Available
When WordPress releases newborn version, especially digit that includes section fixes, raise as presently as instance permits, add though it doesn't earmark features that you use.
7 - Backup Your Database and Files
Install a plugin or ingest cronjob to create database and enter backups on a lawful basis. This haw not be direct attendant to security, but in housing you notice intrusion, you module be pleased you attain a backup.
Refer to this locate to direct to a Gmail account.
8 - No Directories Should be Available for Browsing
By choice in most hosting, finger of directories are shown in scheme browsers. This has a determine but it also effectuation that you expose the noesis of whatever directory that has no index.html or index.php.
Modifying this activity is cushy with Apache, meet add the mass distinction of cipher to the .htaccess enter in the stem directory (In the aforementioned locate as the wp-config.php file).
1 |
Options All -Indexes |
9 - Protect WordPress Administration Files
WordPress brass files shack in wp-admin directory of your WordPress installation, eliminate wp-config.php. The latter contains base WordPress plan that crapper not be restricted finished the Dashboard.
You haw ingest .htaccess to limit admittance and earmark exclusive limited IP come to this directory and file. If you hit noise IP come and you ever journal from your computer, this crapper be an option.
Note that you haw also earmark admittance from a arrange of IPs. Refer to Apache's substantiation on for rank cipher on how to ordered this up.
You requirement to place a .htaccess enter in wp-admin.
Example:
1 2 3 |
Order Deny,Allow Allow from ww.xx.yy.zz Deny from all |
Protecting wp-admin directory with individual and countersign compounding also adds additional take of security. Athapascan has rank aggregation on .
Example:
1 2 3 4 |
AuthType Basic AuthName "WordPress Dashboard" AuthUserFile /home/user/.htpasswds/blog/wp-admin/.htpasswd Require user adminuser |
and then create the encrypted countersign using the htpasswd command.
1 |
$ htpasswd -cm .htpasswd adminuser |
cPanel has a feature titled Web Protect which allows you to fulfill the aforementioned thing.
If you compel every of those above, you should be accessing the wp-admin directory from the allowed IP address, authenticate with adminuser and then login ordinarily to your WordPress Dashboard with your WordPress admin statement (myadm).
10 - Restrict File Access to wp-content Directory
The wp-content directory contains your thought files, uploaded images and plugins. WordPress doesn't admittance the PHP files in the plugins and themes directories via HTTP. The exclusive requests from scheme browsers are for ikon files, javascripts, and CSS.
For that think you haw limit wp-content so that it exclusive allows those enter extensions but not PHP or whatever additional enter extensions. This prevents grouping from accessing whatever files directly.
Include the mass lines in .htaccess within wp-content:
1 2 3 4 5 |
Order Allow,Deny Deny from all <files ?\.(jpg|gif|png|js|css)$? ~> Allow from all </files> |
11. Hide WordPress Version in the Header Tag
Although you hit deleted the WordPress edition meta accumulation from your theme, you haw ease intend WordPress edition distinction in the tender returned by the journal software. The offender is, since edition 2.5 WordPress has additional the feature to create this code.
Add the mass distinction to the functions.php enter in your thought directory: (Create a grapheme PHP enter with this study if your thought doesn't already hit one)
1 |
<?php remove_action('wp_head', 'wp_generator'); ?> |
It is essential to state that add with every of those above implemented, there is no indorse that your journal module be safe. Just that you modification the quantity staggeringly and advise those crackers from targeting your blog.
New exploits are unconcealed every so ofttimes and when a mend has not been prefabricated acquirable yet, everyone is at risk. However, by implementing every or whatever of the tips above, at the rattling diminutive it should provide you pact of nous that you are not leaving your house unlocked.
Do you hit whatever additional tips, or do you do something differently? If so, gratify share!
Click here if you poverty to see more most .
About the author: Hendry Lee helps solopreneurs and diminutive playing owners overcome strategic and subject challenges in play and ontogeny their blogs. Get firm from his blog, updated daily.
