• I am a novice at building a website and I am attempting to limit the number of page revisions stored by WordPress as I have a couple pages with well over 500 revisions (now that the website is up and running the number of revisions will be few and I have realized the importance of saving changes as a draft in Elementor until ready for publishing the revised page). I am running WordPress version 5.9 with Elementor version 3.4.8.

    After reviewing several articles and posts in the WP forums I added the following line to my wp-config.php file: define(‘WP_POST_REVISIONS’, 20);

    This was added just prior to the wp-config.php line item: /* That’s all, stop editing! Happy blogging. */

    This change did nothing to clear out the excess revisions that are of no use to me. I found a WP forum item that indicated moving the line to just after the block text, which I did with no change to the number of page revisions.

    I also found an article in the WP Forum regarding the Revision.php file that has a line item addressing ‘wp_revisions_to_keep”. It implies ‘wp_revisions_to_keep’ may override the value listed in ‘WP_POST_REVISIONS’ but I have no clue if this is impacting me.

    Any suggestions as to why the addition of the “define(‘WP_POST_REVISIONS’, 20);” is not working?

    Darol

    • This topic was modified 2 years, 2 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there,

    I’m a little curious as to what you mean when you say it’s not working? What is it you are expecting? Just trying to get a better understanding here.

    If you mean deleting those previous ones, that could potentially be done with either a plugin or even connecting to the database and running a query but that can easily scare off a few.

    Thread Starter suncountryiris

    (@suncountryiris)

    Thank you for your response. Perhaps my wording was not clear. In two cases the number of page saved revisions shows 551 for one page and 673 for the other (most other pages are approximately at 100 revisions). Based on what I have read changing/adding a line in the wp-config.php file (setting WP_POST_REVISIONS to a value, in this case “20”) should delete all old revisions except for the most recent 20 revisions. However when I view the revision history in WP or Elementor, especially for these two pages, the revision history still reflect 551 and 673 respectively. I thought about a plugin but wanted to limit the number of plugin’s hence I took the path above. This path (adding the code to wp-config.php) is not deleting old revision as expected.

    Dealing with the database is a tad bit above my expertise…… which I am sure I would “mess up”

    Darol

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Ah okay. Gotcha and had a feeling, like I said, I wanted to make sure we were on the same page. It may need to be cleared up by connecting to the database and using a query or using an app like HeidiSQL (https://www.heidisql.com/) to remove those older ones. Yeah, that can be a little daunting specially if you’ve never done something like that.

    The key being making sure you create a backup prior to doing any of that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Revision history’ is closed to new replies.