Leafcap Revision Limits

Description

Leafcap Revision Limits lets an administrator set a revision limit for each post type from one screen, with no code.

Go to Settings > Revision Limits. Each post type that has an admin screen and supports revisions gets its own row, with one of these choices:

  • Use site default: follow WP_POST_REVISIONS, or anything else already applied on your site.
  • Unlimited: keep every revision, even if WP_POST_REVISIONS is a number.
  • Store no new revisions: stop new revisions. Existing revisions stay, but can’t be viewed or restored while this is set.
  • Keep a set number: keep that many revisions per post.

The screen also shows the site default and how many revisions each post type currently stores. Stored counts cover all posts of that type, including autosaves.

Leafcap Revision Limits never runs its own delete. It tells WordPress how many revisions to keep, and WordPress removes extra revisions in its normal way when a post is changed and saved. There is no bulk purge.

The plugin stores its settings in one option, adds no database tables or scheduled jobs, makes no external requests and does no tracking. It works per site on multisite, with no network screen. It works with both the block editor and the classic editor.

Installation

  1. In your WordPress admin, go to Plugins > Add Plugin and search for Leafcap Revision Limits.
  2. Install and activate the plugin.
  3. Go to Settings > Revision Limits, choose a limit for each post type and save.

FAQ

When are old revisions removed?

Not when you save the settings. The next time a post is changed and saved, WordPress permanently deletes its oldest revisions above the limit. Posts that are not changed keep all their revisions.

What does “Store no new revisions” do?

WordPress stops saving new revisions for that post type. Existing revisions are kept, but can’t be viewed or restored until you switch to a limit that allows revisions. If that limit is lower than a post’s revision count, the next changed save removes the extra revisions.

Why does a limit of 1 leave nothing to restore?

The newest revision matches the current content, so keep at least 2 to have an earlier version.

What happens if I deactivate the plugin?

Your settings are kept and no revisions are removed. Revision limits go back to the site default, so if WP_POST_REVISIONS is a number, WordPress trims to that number on the next changed save of each post.

What happens if I delete the plugin?

Its settings are deleted, from every site on a multisite network. No revisions are changed or deleted.

Why does a limit I saved not apply?

Leafcap Revision Limits uses the wp_revisions_to_keep filter. Core’s wp_{$post_type}_revisions_to_keep filter runs after it and can override it, as can another plugin or custom code using either filter.

Can I use this with another revision plugin?

Run only one revision plugin at a time. Two plugins that set revision limits can conflict.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Leafcap Revision Limits” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • First release.