Published on
Dec 17, 2024
Updated on
Jan 02, 2025
Share

Control WordPress Revisions with WPMasterToolKit's Revisions Control Module

Revision management in WordPress is essential for maintaining a balance between modification history and site performance. By default, WordPress records an unlimited number of revisions for each post or page, which can quickly overload the database. It's precisely to address this problem that we've developed the Revisions Control in WPMasterToolKit.

This module lets you easily limit the number of revisions saved, either globally for all content types, or individually by content type (articles, pages, etc.).

Which plugin can the "Revisions Control" module replace?

The "Revisions Control" module can replace specialized plug-ins such as WP Revisions Control or Simple Revisions Deletewhile remaining lighter. Being integrated into WPMasterToolKit, it is optimized to load its resources only when you activate it.

Discover the module : Disable cart fragment scripts

Key features of the Revisions Control module

  1. Global revision management : You can activate a global control to limit the number of revisions on all content types to a defined number.
  2. Granular control by content type : If you prefer more specific management, you can set separate limits for each type of content that supports revisions.
  3. Intuitive interface : A sub-page in the administration menu lets you quickly and easily configure your preferences without technical complexity.
  4. Enhanced performance : By reducing the number of unnecessary revisions, you optimize the size of the database, potentially improving the speed of your site.

How to use the Revisions Control module

Here are the simple steps to take advantage of this feature:

  1. Activate the : Go to the WPMasterToolKit panel, then activate the module Revisions Control.
  2. Access the settings menu: Once activated, a new submenu entitled Revisions Control will be available in the WPMasterToolKit settings.
  3. Set your limits:
    • Enable or disable global control. If enabled, specify the maximum number of revisions to keep for all content types.
      Revision control for WordPress posts
    • If global control is disabled, you can enable control for each content type (such as "articles", "pages") and define a specific number of revisions for each.
      WordPress revision control panel
  4. Save your settings : Click the save button, and the module will immediately apply your preferences.
Discover the module : Disable emoji support

Technical documentation: the hooks used

The module uses a key hook to adjust revision behavior in WordPress:

  • Filter wp_revisions_to_keep This filter is used to dynamically define the number of revisions to keep, according to the settings configured. Here's how it works:
    • If global control is enabled, the globally defined value is applied.
    • If global control is disabled, the value is applied individually according to content type.

Example of code used :

add_filter( 'wp_revisions_to_keep', array( $this, 'limit_revisions' ), 10, 2 );

Why this technical choice?

We decided to use the native filter wp_revisions_to_keep because it's powerful and integrates directly into the WordPress core. This makes it possible to modify revision behavior without unnecessary overhead, while offering maximum compatibility with other WordPress features. What's more, global and granular settings offer flexibility to suit any use case, whether it's a small site or a large one with many custom content types.

Pro
from
2.50$
/Month
14
Days
Money-back guarantee
risk-free at 100 %!

Conclusion

The module Revisions Control is a powerful and flexible solution for efficiently managing revisions in WordPress. By avoiding the accumulation of unnecessary revisions, it helps keep your database optimized, while giving you full control over global and specific settings.

If you're looking to replace several plugins with a lightweight, efficient all-in-one solution, WPMasterToolKit and its module Revisions Control are made for you!

Category
Contents & Media
Version
≤ 1.3.0
Type
Free
More than 18 reviews
+1000
Installations
104
Modules
Pro
from
30.00$
/Year