Best Uses of WordPress wp-config.php File

Best Uses of WordPress wp-config.php File

Silly mistake wordpress users do when installing a wordpress software on web server is leaving wp-config.php file as it is without doing any changes. Recent Statistic shows most of the time hackers tries to attack wp-config.php file first to get vital information about wordpress such as database info and so on.

So precautions is better the cure. Here I am going to give you some helpful tips to do best uses of wordpress wp-config.php file

1. Change WordPress Security Keys

To change your wordpress security keys, please visit https://api.wordpress.org/secret-key/1.1/salt/ . Copy the keys and replace with:

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

2. Change WordPress Database Prefix

WordPress default database table prefix is wp_ which is default and most dangerous for website. So change your wordpress database table prefix to something like wp_bn786_ or whatever you want. But don’t forget to use under score at the end.

$table_prefix = 'wp_bn786_';

3. Force SSL for Admin

If you have a SSL Certificate for website then never miss the chance to force admin or other users to login to your site through Secure Socket Layer – SSL. To force SSL for Admin use this below code in wp-config.php file

define('FORCE_SSL_ADMIN', true);

4. Disable Plugin and Theme Editing

define('DISALLOW_FILE_EDIT', true);

5. Enabling Automatic Updates

define('WP_AUTO_UPDATE_CORE', true);

6. To enable automatic updates for themes, use this below line code :

add_filter( 'auto_update_theme', '__return_true' );

7. Activate Default Theme

define('WP_DEFAULT_THEME', 'twentyfifteen'); // Don't forget to change the theme name with your actual theme

8. Limit the number of posts revisions

define( 'WP_POST_REVISIONS', 3 ); // Don't forget to change the number

9. Activate WordPress Multisite

define( 'WP_ALLOW_MULTISITE', true );

10. Increasing The Memory Limit

define( 'WP_MEMORY_LIMIT', '32M' );
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

Best Uses of WordPress wp-config.php File

Published by

Emdad Khan

I am Emdad Khan, A WordPress Theme Developer and Author of BN Web Design Website. A full time Freelancer on WordPress Theme Development & Optimization as well as blogger.

Leave a Reply