Title: Time-based Revision Cleanup
Author: Michael Sablone
Published: <strong>2024-04-16</strong>
Last modified: 2026-11-06

---

Szukaj wtyczek

![](https://ps.w.org/time-based-revisions/assets/banner-772x250.png?rev=3787419)

![](https://ps.w.org/time-based-revisions/assets/icon-256x256.png?rev=3787419)

# Time-based Revision Cleanup

 Autor: [Michael Sablone](https://profiles.wordpress.org/michaelsablone/)

[Pobierz](https://downloads.wordpress.org/plugin/time-based-revisions.1.1.6.zip)

[Podgląd na żywo](https://pl.wordpress.org/plugins/time-based-revisions/?preview=1)

 * [Szczegóły](https://pl.wordpress.org/plugins/time-based-revisions/#description)
 * [Recenzje](https://pl.wordpress.org/plugins/time-based-revisions/#reviews)
 *  [Instalacja](https://pl.wordpress.org/plugins/time-based-revisions/#installation)
 * [Rozwój](https://pl.wordpress.org/plugins/time-based-revisions/#developers)

 [Wsparcie](https://wordpress.org/support/plugin/time-based-revisions/)

## Opis

**Keep the history. Lose the clutter.**

Keep your WordPress revision history by age, not count.

A busy day of editing shouldn’t erase months of revision history.

WordPress revisions present a familiar tradeoff: limit them by number, and frequent
edits can push important older versions out of reach. Keep them indefinitely, and
your database can accumulate years of revisions.

**Time-based Revision Cleanup takes a smarter approach: keep revisions by age, not
count.**

Choose how long your revision history should last: 30 days, 90 days, a year, or 
whatever works for your site. Every revision inside that retention window can be
preserved, regardless of how often you edit. Older revisions are automatically cleaned
up instead of piling up forever.

**Keep the history. Lose the clutter.**

#### Why time-based retention?

Imagine you limit WordPress to 10 revisions. After 10 more edits, the oldest saved
version is gone, even if it was an important checkpoint from earlier that morning.

With Time-based Revision Cleanup, you can keep **365 days of revision history** (
the default) whether you make five edits or five hundred. The retention period, 
not an arbitrary revision count, determines what gets cleaned up.

It’s a practical balance between useful edit history and long-term database maintenance,
particularly for actively maintained websites.

#### Features

 * **Keep revisions by age, not count.** Set a retention period in days and preserve
   revisions within that window.
 * **Automatic cleanup on save.** Remove expired revisions when content is updated,
   with a configurable execution-time limit.
 * **Optional scheduled cleanup.** Use WP-Cron to work through older revisions across
   the site, including content that hasn’t been edited recently.
 * **Keep editing responsive.** When scheduled cleanup is enabled, you can turn 
   off save-time cleanup and let background maintenance handle the work.
 * **Control the workload.** Set the scheduled cleanup interval, maximum revisions
   per run, and execution-time limits.
 * **See the results.** View total revisions deleted and cleanup activity over the
   last 24 hours, 30 days, 60 days, or year to date. Charts use a locally bundled
   copy of ApexCharts.
 * **Optional activity logging.** Inspect cleanup activity when troubleshooting,
   with logging disabled by default.
 * **Developer-friendly exclusions.** Use the `crtbr_delete_revision` filter to 
   protect specific revisions from deletion.
 * **Works with supported content types.** Manages revisions for posts, pages, and
   custom post types that support WordPress revisions.

No external service, API key, or account is required.

## Zrzuty ekranu

[⌊Cleanup statistics showing the total revisions removed and a chart for the last
24 hours, 30 days, 60 days, or year to date.⌉⌊Cleanup statistics showing the total
revisions removed and a chart for the last 24 hours, 30 days, 60 days, or year to
date.⌉[

Cleanup statistics showing the total revisions removed and a chart for the last 
24 hours, 30 days, 60 days, or year to date.

[⌊Retention and cleanup settings, including the age threshold, save-time processing
limit, and optional logging.⌉⌊Retention and cleanup settings, including the age 
threshold, save-time processing limit, and optional logging.⌉[

Retention and cleanup settings, including the age threshold, save-time processing
limit, and optional logging.

[⌊Scheduled cleanup controls for the interval, execution-time limit, and maximum
revisions processed per run.⌉⌊Scheduled cleanup controls for the interval, execution-
time limit, and maximum revisions processed per run.⌉[

Scheduled cleanup controls for the interval, execution-time limit, and maximum revisions
processed per run.

## Instalacja

 1. Install **Time-based Revision Cleanup** from **Plugins > Add New**, or upload the
    plugin ZIP.
 2. Activate the plugin.
 3. Go to **Settings > Time-based Revision Cleanup**.
 4. Choose a **Revision Retention Period**. The default is 365 days.
 5. Optionally enable **Scheduled Cleanup** for site-wide maintenance, and configure
    its interval and processing limits.
 6. Save your settings. The **Stats** tab shows cleanup activity as revisions are deleted.

Cleanup runs when supported content is saved by default. Scheduled cleanup is optional
and disabled by default.

## Najczęściej zadawane pytania

### How is this different from limiting revisions in wp-config.php?

WP_POST_REVISIONS limits the number of revisions WordPress keeps. A busy editing
session can quickly displace older revisions, even when those revisions are still
useful.

Time-based Revision Cleanup overrides the numeric limit for post types that support
revisions, then uses the configured retention period to determine which revisions
are eligible for deletion.

### Will it clean up revisions that already exist?

Yes. Save-time cleanup processes eligible revisions associated with the content 
being saved. Enable scheduled cleanup to process older revisions across the site,
including posts that are no longer regularly edited.

### Do I need to enable scheduled cleanup?

No. Save-time cleanup is enabled by default. Scheduled cleanup is useful when you
want site-wide maintenance without having to edit each post. It is also the option
to use if you want to move cleanup work away from the save process.

### Can I disable cleanup when saving a post?

Yes. Enable **Scheduled Cleanup**, then select **Disable Save-based Cleanup**. This
lets the scheduled task handle retention without doing deletion work during normal
post saves.

### Does scheduled cleanup run at an exact time?

Not necessarily. Scheduled tasks use WordPress WP-Cron, which depends on WordPress
being triggered by site activity or an external cron setup. The configured interval
controls when cleanup becomes due, not a guaranteed execution time.

### Will this speed up my website or shrink my database?

Removing unnecessary revision records can reduce database clutter and the amount
of revision data stored, especially on heavily edited sites. The actual impact depends
on the site, database, and hosting environment. The plugin does not optimize database
tables or guarantee a particular performance improvement or reduction in disk usage.

### Does it delete published posts or pages?

No. It deletes eligible WordPress revision records, not the published content itself.
However, deleted revisions cannot be restored through WordPress revision history.
Back up your database before making significant changes to your retention period.

### Does it work with custom post types?

Yes, provided the post type supports WordPress revisions.

### Can a developer protect a revision from cleanup?

Yes. The `crtbr_delete_revision` filter receives the deletion decision and revision
object. Returning `false` prevents that revision from being deleted. Protected revision
IDs are also excluded from later scheduled cleanup queries.

### Where are the logs stored?

When logging is enabled, the plugin writes to `wp-content/uploads/time-based-revisions/
log.txt`. The file may be publicly reachable depending on your server configuration,
and it can grow over time. Leave logging disabled unless you need it for troubleshooting,
and ensure the file is protected appropriately.

### What happens when I deactivate the plugin?

Your existing WordPress revisions remain in the database. Deactivation clears the
scheduled cleanup task and preserves your settings, cleanup statistics, and activity
log. Deleting the plugin through WordPress removes its settings, statistics, and
activity log.

## Recenzje

![](https://secure.gravatar.com/avatar/9373958895fcac485d0073fe1f95ca37272ecf52a57d8d624a820c3b9f5a6a6b?
s=60&d=retro&r=g)

### 󠀁[Saved Me Hours!](https://wordpress.org/support/topic/saved-me-hours-18/)󠁿

 [lobozebra](https://profiles.wordpress.org/lobozebra/) 2024-05-20

I installed this plugin on a few of my sites that had issues with the dashboard 
running slow due to the large amount of revisions that my clients were creating.
This really cleaned up the database and sped up the dashboard for users significantly!

![](https://secure.gravatar.com/avatar/9ea1c2f7dc71fa1220c2f413f3e6474a543105c257f984e54dd0dc3cd545d6d0?
s=60&d=retro&r=g)

### 󠀁[Well-designed with the user in mind](https://wordpress.org/support/topic/well-designed-with-the-user-in-mind/)󠁿

 [codeadapted](https://profiles.wordpress.org/codeadapted/) 2024-05-03

I installed the Time-Based Revision Cleanup plugin on my site and and it really 
is a nifty plugin. You can tell the developer knows what he's doing. Really love
the chart visualization and the fact that it does the work of keeping my db clean
and up-to-date. Thanks for the cool plugin!

![](https://secure.gravatar.com/avatar/01d8e0acac91e5e7ac30fa5f0c8920babdb83dfbd21774e03b85d52c2a804f46?
s=60&d=retro&r=g)

### 󠀁[Really Helpful](https://wordpress.org/support/topic/really-helpful-208/)󠁿

 [davgyxyz](https://profiles.wordpress.org/davgyxyz/) 2024-04-24

I've started using the Time-Based Revisions plugin on my site, and it's been really
helpful. It automatically removes older post revisions, so my database stays organized
without any extra effort from me.

 [ Przeczytaj 3 recenzje ](https://wordpress.org/support/plugin/time-based-revisions/reviews/)

## Kontrybutorzy i deweloperzy

„Time-based Revision Cleanup” jest oprogramowaniem open source. Poniższe osoby miały
wkład w rozwój wtyczki.

Zaangażowani

 *   [ Michael Sablone ](https://profiles.wordpress.org/michaelsablone/)

[Przetłumacz wtyczkę “Time-based Revision Cleanup” na swój język.](https://translate.wordpress.org/projects/wp-plugins/time-based-revisions)

### Interesuje cię rozwój wtyczki?

[Przeglądaj kod](https://plugins.trac.wordpress.org/browser/time-based-revisions/),
sprawdź [repozytorium SVN](https://plugins.svn.wordpress.org/time-based-revisions/)
lub czytaj [dziennik rozwoju](https://plugins.trac.wordpress.org/log/time-based-revisions/)
przez [RSS](https://plugins.trac.wordpress.org/log/time-based-revisions/?limit=100&mode=stop_on_copy&format=rss).

## Rejestr zmian

#### 1.1.6

 * Simplified the admin screen header to use the plugin name without a logo image.

#### 1.1.5

 * Secured admin AJAX requests with capability and nonce checks.
 * Added validation for cleanup settings and chart periods.
 * Preserved settings, statistics, and logs during deactivation and reactivation.
 * Fixed the settings page link and refreshed the cleanup schedule when settings
   change.
 * Updated the plugin description, documentation, banner, and icon.
 * Tested with WordPress 7.1.4. Requires WordPress 6.2 for the revision cleanup 
   hook.

#### 1.1.4

 * Version metadata update.

#### 1.1.3

 * Version metadata update.

#### 1.1.1

 * Fixed incorrect CRTBR variable prefixes.

#### 1.1.0

 * Replaced Google Charts with locally bundled ApexCharts.
 * Updated WordPress compatibility information for version 6.8.

#### 1.0.11

 * Added file-based logging.

#### 1.0.10

 * Updated charting documentation.

#### 1.0.8

 * Code cleanup.

#### 1.0.0

 * Initial release.

## Meta

 *  Wersja **1.1.6**
 *  Ostatnia aktualizacja **4 dni temu**
 *  Włączone instalacje **100+**
 *  Wersja WordPressa ** 6.2 lub nowszej **
 *  Testowano do **7.1.4**
 *  Wersja PHP ** 7.4 lub nowszej **
 *  Język
 * [English (US)](https://wordpress.org/plugins/time-based-revisions/)
 * Tagi
 * [database cleanup](https://pl.wordpress.org/plugins/tags/database-cleanup/)[post revisions](https://pl.wordpress.org/plugins/tags/post-revisions/)
   [revision history](https://pl.wordpress.org/plugins/tags/revision-history/)[revision management](https://pl.wordpress.org/plugins/tags/revision-management/)
 *  [Widok zaawansowany](https://pl.wordpress.org/plugins/time-based-revisions/advanced/)

## Oceny

 5 na 5 gwiazdek.

 *  [  3 recenzje 5-gwiazdkowe     ](https://wordpress.org/support/plugin/time-based-revisions/reviews/?filter=5)
 *  [  0 recenzji 4-gwiazdkowych     ](https://wordpress.org/support/plugin/time-based-revisions/reviews/?filter=4)
 *  [  0 recenzji 3-gwiazdkowych     ](https://wordpress.org/support/plugin/time-based-revisions/reviews/?filter=3)
 *  [  0 recenzji 2-gwiazdkowych     ](https://wordpress.org/support/plugin/time-based-revisions/reviews/?filter=2)
 *  [  0 recenzji 1-gwiazdkowych     ](https://wordpress.org/support/plugin/time-based-revisions/reviews/?filter=1)

[Twoja opinia](https://wordpress.org/support/plugin/time-based-revisions/reviews/#new-post)

[Zobacz wszystkierecenzje.](https://wordpress.org/support/plugin/time-based-revisions/reviews/)

## Zaangażowani

 *   [ Michael Sablone ](https://profiles.wordpress.org/michaelsablone/)

## Wsparcie

Masz coś do dodania? Potrzebujesz pomocy?

 [Zobacz forum wsparcia](https://wordpress.org/support/plugin/time-based-revisions/)

## Złóż datek

Czy chcesz wesprzeć rozwój wtyczki?

 [ Wspomóż wtyczkę ](https://www.paypal.com/donate/?hosted_button_id=EUHE8NXYEXJJ6)