Title: Database/Optimizations/Post Revisions
Last modified: June 16, 2021

---

# Database/Optimizations/Post Revisions

 *  Resolved [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * (@mcolorswporg)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/)
 * I just activated this plugin yesterday, and I mainly downloaded it so that I 
   could clean page and post revisions (they have been building up). I went into
   the Database module, and in the Settings, I clicked on ‘Always keep 2 post revisions’.
   The issue is that when I click on the Run Optimization button beside ‘Clean post
   revisions but keep at least 2 revisions’, it will not delete any page revisions
   at all. Thanks in advance for any assistance you could lend here.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatabase-optimizations-post-revisions%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/#post-14565874)
 * [@mcolorswporg](https://wordpress.org/support/users/mcolorswporg/) What makes
   you feel it doesn’t delete any page revisions at all, do you see any erro r pages
   while running the optimization?
 *  Thread Starter [mcolorswporg](https://wordpress.org/support/users/mcolorswporg/)
 * (@mcolorswporg)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/#post-14573013)
 * Ok, I got this to work now. However, there is a bug there, even though it is 
   not a big one. I used to work in QA, so I do have some knowledge about this. 
   It worked for me after I 1) unchecked ‘Always keep 2 post revisions’, and 2) 
   hit the button above the list of settings, ‘Run all selected optimizations’. 
   Of course, this deleted all of my page/post revisions, which is not what I really
   wanted. Although, I feel better that at least I was able to get rid of a lot 
   of clutter. Again, the first two days when it would not work, I was clicking 
   on the ‘Run optimization’ to the right-hand side of the setting, NOT the ‘Run
   all selected optimizations’ at the top. So, this might be where the bug lies.
 * To answer your question above, when it was not deleting any page/post revisions,
   I observed that 1) just beneath the ‘Clean all post revisions’ in small type 
   it said something like ‘0 post revisions deleted’, and 2) when I went into edit
   mode for any of my current pages, it still said XX number of page revisions existing.
   That is my proof.
 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/#post-14573142)
 * [@mcolorswporg](https://wordpress.org/support/users/mcolorswporg/) Glad to hear
   it worked now, I’ll share your findings with our development team
 *  [edoalive](https://wordpress.org/support/users/edoalive/)
 * (@edoalive)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/#post-14584258)
 * Hello,
    I stumbled on the same problem, but unlike [@mcolorswporg](https://wordpress.org/support/users/mcolorswporg/),
   I did not try to delete all revisions. What I see is that if the setting `Always
   keep X post revisions` is disabled, in the Optimizations tab it shows `1,312 
   post revisions in your database`. If I enable for example to keep 5 post revisions,
   that number changes to 987 so it seems to correctly count them. But when I click
   run optimizations, it only deletes just a small bunch (less than 10, most times
   0) of revisions. This happens whether I click the button in the single row or
   the check then the `run all selected optimizations` button. I also checked the
   database for the number of revisions, and many posts have more than hundreds 
   of revisions after the run so nothing changes. This is the query I used to check:
 * > SELECT COUNT(ID) as NUM, post_parent, post_type FROM `wp_posts` where post_type
   > =”revision” GROUP BY post_parent ORDER BY `NUM` DESC
 * Please take a look at this behavior because I specifically choose this plugin
   for the ability to keep a number of revisions. And this seems to be the only 
   plugin to offer that. If only it worked.
    -  This reply was modified 5 years, 1 month ago by [edoalive](https://wordpress.org/support/users/edoalive/).
      Reason: Added query

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

The topic ‘Database/Optimizations/Post Revisions’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [edoalive](https://wordpress.org/support/users/edoalive/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/database-optimizations-post-revisions/#post-14584258)
 * Status: resolved