27 Nov 2008 @ 5:26 PM 

If you have run a WordPress blog for any length of time, you should know how large the SQL database can get.

This is largely due to the “Post Revisions”, which get auto-saved.
If you edit a post a few times, a huge list of revisions gets saved to the database. You can see these at the bottom of the post editing page.

This post has easy methods to disable and delete the post revisions, which are automatically cached by WordPress.


If you don’t use or need the post revisions which Worpdress has already saved for you, then you can delete them all by using the SQL query below:

DELETE FROM wp_posts WHERE post_type='revision';

You can also disable it from executing to start with by opening wp-config.php in your blog’s home directory.
Add these lines under “define(‘DB_COLLATE’, ”);”

define ('WP_POST_REVISIONS', 0);
define('AUTOSAVE_INTERVAL', 600);

There is also a great WordPress Plug-in called WP-CMS Post Control, which gives you more control over how posts are edited.
This great WordPress plugin will allow you to:

  • Force standard browser upload instead of Flash upload
  • Turn off the revisions feature
  • Turn off the auto save feature
  • Create a collapsable message panel that appears below the write panel
  • Control which options are shown on the post page

I prefer to use the manual method, as too many plug-ins for WordPress can cause problems.

I don’t know anyone that has found the post revisions that WordPress saves, usefull.
Maybe in a future edition (v2.7 hopefully), they will include an option to disable from the admin control panel. But untill then thousands of blog owners will have to do it manually or use a plugin!



  • Technorati
  • StumbleUpon
  • Reddit
  • del.icio.us
  • Facebook
  • MySpace
  • LinkedIn
  • Live
  • Sphinn
  • MisterWong
  • Slashdot
  • Tumblr
  • Wikio
  • Yahoo! Buzz
  • BlinkList
  • Google Bookmarks
  • Print
  • email
Posted By: Abe
Last Edit: 08 Aug 2009 @ 11:56 AM

EmailPermalink
Tags
Tags: ,
Categories: Web Design


 

Responses to this post » (7 Total)

 
  1. SEO says:

    Great post. Thanks for sharing!

  2. [...] I've probably seen it at least a dozen times. Just now when I was searching for it I found it here. But because I need to have the code handy here's the [...]

  3. TechForum says:

    Should this speed up wordpress at the same time? I’ve got WP running on one site and it takes almost 2 seconds to generate the page (debug says that’s down to PHP, not MySQL though?)

  4. Abe says:

    @TechForum:
    It won’t hurt. The main reason WordPress is slow, is due to the way it caches files.

    A WordPress plugin like WP Super Cache should help bring the PHP page generation time down a lot ;)

  5. angelez says:

    is this same as like

    define('WP_POST_REVISIONS', false);

    whats the difference?

  6. Abe says:
    define('WP_POST_REVISIONS', 0);
    define('AUTOSAVE_INTERVAL', 600);

    And

    define('WP_POST_REVISIONS', false);

    Are the same, but the top version will also disable the Autosave feature too.

    I found the Autosave to be more annoying than useful. I tend to edit posts many times to get the required page layout, so I did not to use it very much.

Post a Comment

You must be logged in to post a comment.

Change Theme...
  • Users » 195
  • Posts/Pages » 37
  • Comments » 28
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

DDO Forum



    No Child Pages.

Login



    No Child Pages.