Categories

Featured templates

WordPress. Useful engine configuration tricks that you may not know

Daniel Morales January 25, 2016
Rating: 5.0/5. From 3 votes.
Please wait...

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.

  1. One of the useful tricks for ‘wp-config.php’ file is the ability to detect the database host:

    define('DB_HOST', $_ENV{DATABASE_SERVER});

    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.

  2. 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:

    define('WP_ALLOW_REPAIR', true);

    WordPress_Useful_engine_configuration_tricks_1

  3. You can define the filesystem method to be used on the server:

    define('FS_METHOD', 'direct');

    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.

  4. 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
  5. 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');
  6. 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
  7. 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 
  8. 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

    WordPress_Useful_engine_configuration_tricks_2

  9. If you do not like trash feature, you can disable it by adding the function below:

    define('EMPTY_TRASH_DAYS', 0 );
  10. 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:

    define('WP_MEMORY_LIMIT', '64M');

    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.

Premium Wordpress Themes
This entry was posted in WordPress Tutorials and tagged configuration, engine, trick, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket