secure-wordpress
How To Secure WordPress configuration file

How To Secure WordPress configuration file

Nur . Posted in How-To 580 Views

Web site running on WordPress has many benefits over other Content Management Systems, and the most important is wp-config.php file that contains very sensitive information about your WordPress installation, including your database detail, table prefix and Secret Keys.

So this file should be secure from hackers because they can find the valuable information stored in the wp-config.php file.If someone get access this file, he can get website database username and password, he could log in and undo everything that you’ve built! Therefore, take whatever steps you can to secure that file so that no one can access it.To do so, follow these steps:

How to protect your WordPress wp-config.php file:

Protect it the .htaccess Way

Josiah Cole wrote a nice htaccess tutorial on modifying your .htaccess to protect the wp-config.

Here’s the code from  Digging Into WordPress:

# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>

After updating your  wp-config.php, Change file permission (chmod) on wp-config.php to 640.

Move the WP-Config file to a secret folder

If you move the wp-config file to an unpredictable location and change the code, it would create a problem every time you upgrade WordPress. So there is a better solution, create a separate PHP file in a non-WWW location and add the location of WP-Config file in it. On the following link you can find detail about How to create PHP file and add secure location it: Protect WordPress wp-config.

If you found this post helpful or have any questions, please leave your comment below.

Nur

I am a Wordpress, Website Developer and Designer, creator @ WP Arena, Provide Free WordPress consultation and can help to install WordPress in a secure way to small businesses and bloggers.

Free & Professional WordPress Security Service Free & Professional WordPress Security Service

We Love WordPress. WordPress Arena is a place for WordPress Developers and Designers, providing Tips, tricks, tools and resources to build a website or blog on WordPress. We also present The WordPress Showcase for all kind of WordPress Powered Websites.

Recent Comments

Anderson

|

Dont work with post_type? ‘post_type=property&numberposts=1′