wp-config.php code snippets for autosave, post revisions, trash settings

April 28, 2010 | No Comments Yet

These are useful lines of code modifying the default settings on post revisions and autosave intervals, which you can insert in your WordPress site’s wp-config.php file at the root folder.

define('AUTOSAVE_INTERVAL', 160 );

Explanation: Set the length between autosaves to 160 seconds.

define('WP_POST_REVISIONS', false );

Explanation: Disable post revisions completely.

define('WP_POST_REVISIONS', 3);

Explanation: Limit the number of post revisions to 3. (Tip: install Revision Diet so you don’t need to do this manually, and you can also delete excess revisions created beforehand.)

define('EMPTY_TRASH_DAYS', 0 );

Explanation: Disable the Trash functionality completely.

define('EMPTY_TRASH_DAYS', 30 );

Explanation: Set the number of days between the contents of the WordPress Trash bin are completely deleted—posts, pages, comments, etc. This will be done automatically and without confirmation.

Even more snippets can be found at the Codex. Though I hope that in the future, WordPress can integrate these as configurable settings in the admin interface.

Leave a Comment | Tags: , , , , , , ,