WordPress Function to Set a maximum number of post revisions to avoid DB bloat

Set a maximum number of post revisions to avoid DB bloat.

Tested on: WordPress 3.0.1

Default is infinite, this will set it to only remember last 5 edits:

/**
 * Set the post revisions unless the constant was set in wp-config.php
 */
if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 5);

FWIW there are a ton of great ideas for CONSTANTS that can be set on the Codex page Editing wp-config.php.

You may also like...

Leave a Reply

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