Protect Your wp-config.php With .htaccess in WordPress

| Last Updated: | In: WordPress, WordPress Snippets


This is a very quick tutorial which let you know how to protect your wp-config.php file from hackers by using the .htaccess file in your WordPress website. The wp-config.php file has very critical information of your website like database connection information.

Protect Your wp-config.php with .htaccess in WordPress

Open the .htaccess file from root directory of your server and add the below code at the end of the file and save it. below code will prevent access to your wp-config.php file.

Download WordPress Security Guide eBook and Protect Your WordPress Site

I have written an eBook to protect your WordPress website from hackers/attackers by implementing the security guidelines with your site. If you are a serious WordPress developer OR WordPress website owner, then you must implement the Security Guideline in your WordPress website. It will help you to protect from hackers/attackers.

If you like this tutorial, then do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , , ,