Home About Blog Resources
Resources - WordPress
Home  »  WordPress   »   WordPress Config File

WordPress Config File


Tips For wp-config.php

Cut the database bloat:

Post revisions can begin to bloat your database if you are doing a lot of daily blogging. You can set the number of post revisions (3 in this case):
define('WP_POST_REVISIONS', 3);

If you want to disable revisions completely:
define('WP_POST_REVISIONS', false);

By default, WP autosaves every 60 seconds. You can set this to 3 minutes:
define('AUTOSAVE_INTERVAL', 180);

WP empties the trash every 30 days. Plus things in the trash can still be active on your site even though it is in the trash. It must be deleted to be truly removed form your site. Setting the number to 0 will disable the trash and deletion will happen immediately.
define('EMPTY_TRASH_DAYS', 7);

Lock Your Domain Name

Hard code the blog and site url so clients won’t accidentally break their site. By adding the two lines of code below, this will grey out and disable the domain addresses in Settings > General:
define('WP_HOME', 'http://domain.com');
define('WP_SITEURL', 'http://domain.com');

See The Errors

Allow debugging to display the errors that are going on in your site:
define('WP_DEBUG', true);
Turn this back to false when the site is ready for the public.

Fix Memory Limits

Increase the memory size. If you see a message that says: “Allowed memory size of 76749 (or other number) bytes exhausted, try this trick. Check you host to see if this is allowed for your account:
define('WP_MEMORY_LIMIT', 256);