WordPress.org

Ready to get started?Download WordPress

Ideas

Native function to delete post revisions

  1. damsko
    Member

    12345

    I'm also still hoping...

    For the record; since my last post on this topic the number of post revisions still stored and cleaned grew from 4899 revisions to currently 5235.

    I do use the line in wp-config.php that should disable post revisions getting stored:

    define('WP_POST_REVISIONS', 0);

    Somehow that does not 100% stop revisions still getting stored.

    My only tool to remove them is the 'Better Delete Revision' plugin. It luckily still works on WordPress 3.5. It can be found here:
    http://wordpress.org/extend/plugins/better-delete-revision/

    Please (re-)consider making post revisions management a native option as suggested earlier:

    ... it would make good sense to have a option in WordPress Settings under by example "Writing" to enable/disable Post Revisions and to clean-up/remove stored (redundant) revisions. Those two options would be most important in my vision. Limiting number of post revisions but keeping enabled the revisions could be extra option.

    Posted: 1 year ago #
  2. Ruth Maude
    Member

    I put this in my config file but I've tested and it isn't working. I'm getting more revisions saved.

    define('WP_POST_REVISIONS', 5);

    What I would love is for WordPress to have a delete revisions on publish option. Once I've published the post I don't need the revisions anymore but in draft mode they're great.

    The plugin damsko mentions hasn't been updated in over 2 years. I'm going to try Revision Control http://wordpress.org/extend/plugins/revision-control/

    Posted: 1 year ago #
  3. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    How many revisions 'extra' are we talking? It;s possible the pre-initial-save auto save is doing that.

    Posted: 1 year ago #
  4. Ruth Maude
    Member

    They just never stop. The Revision Control plugin seems good.

    Posted: 1 year ago #
  5. kitchin
    Member

    Great idea, but don't use the "Better Delete Revision" plugin as a basis, it has a dataloss bug. Looks to me like "Optimize Database after Deleting Revisions" http://wordpress.org/plugins/rvg-optimize-database is more actively developed. It uses WP term functions to maintain the taxonomy tables rather than raw MySQL, which is where the bug is in the other plugin. Now that WP 3.6 has more revision features, maybe there is hope for a "delete" function. A full description of the bug in the commonly seen MySQL deletion code is here: http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere

    Posted: 11 months ago #
  6. kitchin
    Member

    Actually, Ruth is right, the Revision Control plugin http://wordpress.org/plugins/revision-control/ seems to handle deletion better than rvg, just looking at the code.

    Also, WP has had a deletion function since 2.2, wp_delete_post_revision()! But the plugin adds an action to clean up the taxonomy afterwards, which seems pretty important if you're going to have a delete function. And it's a one-line fix, thanks to another WP function, wp_delete_object_term_relationship(), unless I'm missing something.

    Posted: 11 months ago #
  7. damsko
    Member

    12345

    hi kitchin,

    thanks for your feedback on this topic here on this thread and on your "Deleting Post Revisions: do NOT use the a,b,c JOIN code you see everywhere" thread:
    http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere

    will follow your advice not to use "Better Delete Revision".

    was still using it and it seems to be working fine but i can not oversee problems or risks like you now mentioned.

    this is part of why i hoped and still am hoping for a native WordPress function to delete post revisions, there should be good and save option to manage this.

    will have a look at "Optimize Database after Deleting Revisions":
    http://wordpress.org/plugins/rvg-optimize-database/
    as alternatitve to "Better Delete Revision".

    Posted: 11 months ago #
  8. kitchin
    Member

    The problem with the "a,b,c" MySQL deletion will only happen if links have the same database ids as posts. Typically there are very few links, with low id's. So those are the posts to check to see if their tags and categories are still there.

    Posted: 11 months ago #
  9. utnalove
    Member

    12345

    I agree. Databases keep growing far too much with the reviews. Yes, we can limit them from the wp-config.php, but what about the blogs that are live already many years, have thousands of unnecessary revisions? How to delete them? Only via 3rd party plugins...

    Posted: 10 months ago #
  10. ClaudiuCC
    Member

    this is a no brainer. an option to delete revision should have been included already.

    the wp team shouldn't have launched the revisions option without the option to delete them.

    Posted: 4 months ago #

RSS feed for this topic

Reply »

You must log in to post.