• I am attempting to run the MySQL Query

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

    to delete post revisions (to try to get my site running quicker). I am using MyPhpAdmin through cPanel at BlueHost, and it asks me to “choose at least one column to display”. I’ve tried running the Query with the

    ‘wp_posts’.*

    column selected, but the result is only a tiny bit smaller size of databas, so I presume that was the wrong guess, as I’d guess that it should make a big difference to the size of database because most of my posts have lots of things edited before they finish.

    Thanks in advance for any advice on this!

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • Why not use the Better Delete Revisions plugin?

    If not you might find the code if you download the plugin!

    HTH

    David

    Thread Starter chris-melchior

    (@chris-melchior)

    thanks for the idea. As I’m trying to make my site faster, I’d rather try to avoid using even more plugins as I’ve been told that each plugin makes it slower! But thanks for the idea anyway!

    By the way, I’ve tried the query on “SQL” where you can run a query on the database, and that just gives errors.

    Anyone know how to do this correctly?

    thanks

    Chris

    Thread Starter chris-melchior

    (@chris-melchior)

    Thinking further, I’ve already changed things so that I am not saving future revisions, so I guess running the Better Delete Revisions plugin, then deleting it, would presumably do what I want, so I’ll try that.

    thanks again 🙂

    chris

    thanks for the idea. As I’m trying to make my site faster, I’d rather try to avoid using even more plugins as I’ve been told that each plugin makes it slower! But thanks for the idea anyway!

    Then why not load and activate the plugin, run it and clear the revisions, then de-active and even delete it if you want, why re-invent the wheel.

    The time saved not by-passing the WordPress function calls and playing with the tables can be used in optimising other parts of the website?

    HTH

    David

    Thread Starter chris-melchior

    (@chris-melchior)

    Yes, exactly, that’s what I’ve just done 🙂

    thanks very much for your help 🙂

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Which "column" to run a MySQL Query on to delete revisions?’ is closed to new replies.