WordPress Q&As Logo
WordPress Q&As Part of the Q&A Network
Q&A Logo

How can I limit post revisions to save database space?

Asked on Oct 08, 2025

Answer

To limit post revisions in WordPress and save database space, you can set the maximum number of revisions WordPress will store for each post. This is done by adding a line of code to your `wp-config.php` file.
<!-- BEGIN COPY / PASTE -->
    define('WP_POST_REVISIONS', 5);
    <!-- END COPY / PASTE -->
Additional Comment:
  • Replace "5" with the desired number of revisions you want to keep.
  • Setting the value to "false" will disable revisions entirely, but this is not recommended as revisions can be useful for content recovery.
  • Make sure to back up your `wp-config.php` file before making changes.
  • Reducing revisions can help optimize database performance, especially on large sites.
✅ Answered with WordPress best practices.

← Back to All Questions
The Q&A Network