Delete revision (3 posts)

  1. cryonics
    Posted 6 years ago #

    To delete revision here is their solution:

    # DELETE a,b,c
    # FROM wp_posts a
    # LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
    # LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
    # WHERE a.post_type = 'revision'

    I wonder if something is wrong with this request:

    DELETE FROM wp_posts WHERE post_type = "revision";

    What is stored in postmeta?

  2. Benjamin_SP
    Posted 6 years ago #

    All sort of stuff are stored in post meta like all your revisions, auto saves, custom field values, and even accumulated plugin info. If you want to disable revisions and that method doesn't work you can try the next best thing in this plugin:


    It works great.

  3. cryonics
    Posted 6 years ago #

    I have made a try with two local installation of WP, and it appears that deleting just revision posts leaves additionnal field in postmeta.

    I must conclude that the second and simpler query is bad (even if it is published as a solution by several bloggers).

    I suppose the plugin make use of the first one instead.

Topic Closed

This topic has been closed to new replies.

About this Topic