Set WordPress to empty the trash automatically after a number of days.

define( 'EMPTY_TRASH_DAYS', 30 );

Change the Autosave Interval for your posts, pages, etc.
Set the seconds that you would like to have your content saved while you are editing it.

define( 'AUTOSAVE_INTERVAL', 160 );

Limit posts revisions. Or disable them with setting it to false.

define( 'WP_POST_REVISIONS', 3 );

Enable the Debug mode without displaying it on your pages.
These lines will save the error log into debug.log file in your wp-content/ directory.

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);

The following lines are already in the wp-config.php file, and you should always change the default values.
A way to do this is going to https://api.wordpress.org/secret-key/1.1/salt/ and replace the default values with the ones given.

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');

Enable Multisite functionality.

define( 'WP_ALLOW_MULTISITE', true );

Define the Site URL address.

define('WP_HOME', 'http://www.wptips.me');
define('WP_SITEURL', 'http://www.wptis.me');

Override file permissions.

define('FS_CHMOD_FILE', 0755);
define('FS_CHMOD_DIR', 0644);

You can set Automatic Database Optimizing. If a database is corrupt normally the user isn’t able to login so to run this script the user doesn’t need to be logged in. It’s recommended to delete this line after you repair your database.
After including the line in your wp-config.php the script can be found at http://your_domain/wp-admin/maint/repair.php

define( 'WP_ALLOW_REPAIR', true );

You can increase your PHP memory limit (won’t work with all hosts).

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

Define custom user tables.

define('CUSTOM_USER_TABLE', $table_prefix.'custom_users');
define('CUSTOM_USER_META_TABLE', $table_prefix.'custom_usermeta');

Disable plugin and themes editors:

define( 'DISALLOW_FILE_EDIT', true );

Change the wp-content directory name and location:

define( 'WP_CONTENT_DIR', dirname(__FILE__)  . '/some-folder/site-content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] .  '/some-folder/site-content';

Save the database queries to an array stored in the global $wpdb->queries.
This will have a performance impact on your site, turn off when not debugging.

define('SAVEQUERIES', true);

And don’t forget to protect your wp-config.php through the .htaccess file:

1
2
3
4
5
 
<Files wp-config.php>
    order allow,deny
    deny from all
</Files>

For more advanced use of wp-config.php visit http://codex.wordpress.org/Editing_wp-config.php

Extra configuration in wp-config.php
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *