Title: Limit revisions plugin
Last modified: January 4, 2024

---

# Limit revisions plugin

 *  [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * (@mcolorswporg)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/)
 * I am on WordPress 6.4.2 running [Twenty Fifteen](https://5elementdiet.net/wp-admin/themes.php)
   theme. I am looking for recommendations for plugins that are known to be safe
   and will allow for limiting the number of revisions for a page or post. After
   searching previous topics about this, I could not find anything newer than 2 
   1/2 yrs ago. I am not great with coding and do not have staff to help me with
   coding at this time. Thanks! Michael
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flimit-revisions-plugin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/#post-17318842)
 * All the plugin would do is set a particular constant value or hook the “wp_revisions_to_keep”
   filter. Both accomplish the same thing. The benefit of a plugin is it likely 
   provides a simple setting where you can easily specify the limit. So even though
   they’re old, they likely still work fine. Are they still safe? Likely, but I 
   cannot guarantee it.
 * I know you don’t want to do any coding, but this is about as simple as coding
   can get. Add this line to wp-config.php:
    `define( 'WP_POST_REVISIONS', 5 );`
   You may change the 5 to any reasonable positive integer value you like. Insert
   this line immediately above this one that should already be there: `/* That's
   all, stop editing! Happy publishing. */`
 * The greatest difficulty here is in downloading the file for editing, then uploading
   the new version back. This is commonly done via FTP, but if you don’t already
   have an FTP connection set up it’ll be easier to use your hosting account’s file
   manager to download/upload the file.
 * Even though the change is simple, I recommend keeping a backup copy of the current
   file version so it can be easily reverted to should anything go wrong.
 *  Thread Starter [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * (@mcolorswporg)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/#post-17321430)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/), thanks very much for
   your reply. I appreciate that you went into detail about how to code this change.
   And because of this, I decided to give it a try.
 * I feel that I paid attention to your instructions, and was able to add this coding
   to the wp-config.php file successfully. My hosting company provides an in-house
   File Manager tool, so I did not have to use an ftp program. The problem is that
   after I coded the change, and then logged out and logged back into my WP site,
   the revisions still showed what they were previous to the coding change. I set
   the coding to 3 instead of 5 revisions. It seems that editing the file was pretty
   simple. What other troubleshooting can I do? Other than clearing the page cache,
   are there other ways to clear the revisions that are still present? Do I need
   to download a plugin temporarily to clear the revision count back to zero?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/#post-17323086)
 * Ah yes, I should have mentioned that the added code only affects new revisions.
   Any existing revisions remain. Sorry for the omission.
 * Removing existing, undesired revisions is a lot more complicated. I recommend
   looking at some [DB clean up](https://wordpress.org/plugins/search/database+cleaner/)
   plugins for one that will remove excessive revisions for you.
 * But keep the code you’ve added so you will no longer accumulate more excessive
   revisions.
 * In case you were wondering, `define( 'WP_POST_REVISIONS', 5 );` is absolutely
   safe and secure because it’s all static, there can be no influence from outside,
   or from within for that matter.
 *  Thread Starter [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * (@mcolorswporg)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/#post-17323143)
 * Super helpful!! I just downloaded and ran an optimizer plugin for database clean-
   up, etc., and it worked great.
 * Thanks again for your assistance, Michael

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Limit revisions plugin’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/limit-revisions-plugin/#post-17323143)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
