• Home
  • Download Free eBook
  • OC Archives
  • Tools I Use
  • Webmaster Forum
  • Write For Us
Logo

  • Discounts
  • SEO Central
    • All other Search
    • Bing
    • Google Central
    • Yahoo
  • Social Networks
    • Digg
    • facebook
    • Squidoo
    • Technorati
    • Twitter
  • Web Design & Development
    • Ajax
    • Coding
    • Database
    • Graphic Design
    • Joomla
    • jQuery
    • OScommerce
    • Photoshop
  • Webmaster Central
    • Author's Corner
    • Case Studies
    • Content Writing
    • Featured Interviews
    • Guest Posts
    • Make Money Online
    • OC Promos
    • Premium Reviews
    • Video Tutorials
    • Web Hosting
    • Web News
    • Web Security
  • Wordpress

How to Delete WordPress Post Revisions or auto saved posts

Posted by Joshu on Dec 22, 2009 in Tutorials, Wordpress | 6 comments

Its important to maintain your database table size and optimize them regularly when your blog is regularly being updated.

Delete and remove all existing stored post revisions and changes made on pages stored in the database in order to reduce the wp_posts table size, especially when there is already tons of revisions or changes been kept.

Method 1

To delete and remove all existing post revisions entries and rows from WordPress database Posts table, simply login to MySQL command-line interface, phpMyAdmin, SQLyog or other MySQL GUI tools. Select the appropriate WordPress database (if you have more than one databases on the same server), and then issue the following command (it’s also recommended to backup the database before performing the deletion SQL statements):

DELETE FROM wp_posts WHERE post_type = “revision”;

Once all post revisions related records is purged, all revision histories is deleted, and users no longer able to check the changes by phase or compare differences between versions.

Method 2

Add the below line to  to your wp-config.php file and  change the 6 to however many revisions you want or -1 to keep them.

define(‘WP_POST_REVISIONS’,6);

Method 3

Also you can use the WP plugin here   to delete old revisions.

Hope you enjoyed the post, let us know your comments

[ratings]


Related Articles You Are Probably Interested In:

  1. How to Mass delete autosaved posts in WordPress
  2. Tutorial: How to Disable or Limit or Delete Autosave Post-Revisions in WordPress
  3. How to Mass Delete pending posts in WordPress
  4. Life Saving SQL Queries for a WordPress Blogger
  5. Auto post from your WordPress Blog to FaceBook Fan Page
  6. How to Mass Delete Spam Comments at once?
  7. How to Auto Post to FaceBook?
  8. How can users submit Posts from Frontend in WordPress?

6 Responses to “How to Delete WordPress Post Revisions or auto saved posts”

  1. The Method says:
    January 3, 2010 at 1:52 pm

    I was searching for Blogs about How to Delete WordPress Post Revisions or auto saved posts | OC Blog and found this site. I am interested in your content and I appreciate sites like this.

    Reply
    • admin says:
      January 6, 2011 at 2:02 am

      Thank you for your kind words! Am glad that it helped.

      cheers
      Josh

      Reply
  2. Merrick Before GrainChickenDog says:
    May 28, 2010 at 10:59 pm

    Wonderful idea!!! I would like to thank you for informing this here. It will be very useful to me.

    Reply
    • admin says:
      January 6, 2011 at 2:03 am

      Glad that it helped you.

      cheers
      Josh

      Reply
  3. Joshuthomas says:
    September 23, 2010 at 12:22 pm

    Welcome buddy !!

    Reply
  4. khaleed says:
    June 18, 2011 at 8:35 pm

    Hi,

    Great and thanks for the tutorial but I think you forget to mention that when googlebot crawl the website they will see as a duplicate.

    One more thing the command that you write doesn’t work
    DELETE FROM wp_posts WHERE post_type = “revision”;
    The “revision” should be only contain ‘revision’.

    Anyway your article help me a lot on how to delete the autosave in wordpress because many articles I found doesn’t mention that we have to choose a database first before we can delete all revision. lol

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

CAPTCHA Image
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 Subscribe to OC Blog! 

Subscribe to OC Blog

Stay tuned to the Latest updates and tips in the Webmaster World




Most Popular Posts

  • List of High PR do follow blogs (Verified) (305)
  • Next Google Page rank - PR update 2011 (278)
  • Market Samurai Discount – Save 80 USD! (234)
  • 300 High paying adsense keywords 2011 (104)
  • List of High PR Dofollow Directories 2011 (88)
  • 22 OpenSource Forum Scripts - Details and Download: update list (82)
  • Best Classifieds Ads Scripts (75)
  • How to modify the Wordpress comment Form (65)
  • Review of the List of the Best Social Networking websites 2011 (61)
  • List of 200 Highest paying Adsense Keywords : Updated list 2010 (44)
  • 10 Best Premium Wordpress Plugins (43)
  • Featured Interviews: Harsh Agarwal from ShoutMeLoud.com (43)
  • Elegant Themes Discount 2011 (Save 10 USD) (42)
  • List of all Top Social Networking websites as on 2010 (38)
  • One of the Biggest SEO Secret for Linkbuilding (37)
  • 14 Best Ajax Scripts to use for any website (37)
  • Download KeywordLuv WordPress Plugin (37)
  • How i earn Big Bucks from my blog Doing Nothing! (37)
  • Fatal Error on WordPress 3.3 Version Upgrade (37)
  • 30 Best wordpress Plugins required for Any WP Blog (36)
About OrangeCopper Network 

Who am I? Am Joshu. I enjoy blogging about webmaster related stuff and technology. Xtras - I Design, Develop, Blog and Support the Open Source. Passions: I Love Music, Photography, Design, Development, Cycling, Travelling and sleeping (Favorite)

What i could do for you: Ive been working on various shades of the web for over 11 years now and learned the hard way, Now i could help you learn it the Easy way. OrangeCopper is a Webmaster community that i started in the year 2002 and is now a platform for webmasters around the world. Thankyou for spending your time to visit Blog. I would love to get connected every webmaster reading this, follow me on Twitter and i would auto follow you. Thanks again, Happy Surfing!

Interested to Learn Professional Blogging? Check out my NapIncome Blog where I share all the secrets to build a professional blog and earn money from ProBlogging.

Please Subscribe to the Blog Newsletter to get regular weekly update
Twitter: http://www.twitter.com/orangecopper | Subscribe to feeds : http://feeds.feedburner.com/orangecopper/ilRl

Other OrangeCopper Network Websites

ConnectRing Web Directory | UsedMobiles.in | UsedGadgets.in | NapIncome Strategy Blog | HippieMonk Technology Blog | All Good WordPress Themes | PixelTribes Photography Blog | Yscream Web Hosting

Favorite Articles

  • List Of Best Classifieds Ads Scripts Ever (Free & premium)
  • How to triple your Blog Subscription rates / opt-ins – It Worked for me!
  • You can certainly spend Half a Dollar For creating a GREAT Blog
  • How i earn Big Bucks from my blog Doing Nothing!
  • 35 best free wordpress themes for download: updated list 2010
  • 22 Web 2.0 Colors and their codes in HTML
  • 48+ web Design Related Twitter Accounts To Follow
  • Make a web 2 icon with Photoshop in easy 8 steps
  • List of 62 Free Press Release websites

    Most Rated Articles

  • Compare WordPress – Joomla – Drupal and their features
  • 7 Excellent jQuery menus and jQuery examples and downloads
  • 5 Most Important To Do s for a New Blog Launch
  • How to colorize with adobe Photoshop
  • Free Magento Themes / Templates Download: updated list
  • How to install wordpress step by step tutorial
  • List of 200 Highest paying Adsense Keywords : Updated list 2010
  • How to display Exit Splash or Exit message for website
  • How to promote your old Blog posts