This tutorial will describe 10 WordPress Configuration Tricks that might be useful for your website.
‘wp-config.php’ file is the most important file in the entire WordPress installation. This file can be used to improve security on your website, enhance performance and configure database functionalities.
One of the useful tricks for ‘wp-config.php’ file is the ability to detect the database host:
Paste the code above into ‘wp-config.php file’ and it will most likely grab the database server. For this, you will have to manually edit the ‘wp-config.php’ file though.
WordPress can automatically look for some common database problems and repair them. WordPress can also attempt to optimize the database. This improves performance in some situations. To enable this feature, you would need to use the following function:
You can define the filesystem method to be used on the server:
FS_METHOD constant forces the filesystem method. It should only be ‘direct’, ‘ssh2’, ‘ftpext’, or ‘ftpsockets’. Generally, you should only change this if you are experiencing update problems.
For developers, WordPress offers debugging feature which allows them to find errors and deprecated functions. By default, this function is set to false, but in the development mode:
define(‘WP_DEBUG’, true); // enable debugging mode
In WordPress Settings, you specify the WordPress address and the site address. Those are added in your database, and every time the developer calls it in the template, it is running a database query. By adding the line below in your ‘wp-config.php’ file, you are reducing the number of database queries thus increasing your site’s performance:
define('WP_HOME', 'http://info.template-help.com/help'); define('WP_SITEURL', 'http://info.template-help.com/help');
You can override file permissions, if your host has restrictive permissions for all user files:
define('FS_CHMOD_FILE', 0755); // sets permissions on files define('FS_CHMOD_DIR', 0644); // sets permissions on folders
By default WordPress saves post every 60 seconds, but if you think that is way too much, then you can modify it to your liking with this configuration:
define('AUTOSAVE_INTERVAL', 100); // in seconds
By default the trash feature of WordPress empties itself every 30 days. You can modify that by using the following function:
define('EMPTY_TRASH_DAYS', 10 ); //Where 10 is the amount of days
If you do not like trash feature, you can disable it by adding the function below:
define('EMPTY_TRASH_DAYS', 0 );
There is a common WordPress Memory Exhausted Error that users have seen when activating some plugin. You can increase the PHP Memory Limit through ‘wp-config.php’ file. Simply paste the code below:
Note: This feature may not work with some web hosts, so you will have to ask your hosting provider to increase your PHP Memory limit on their end.