|
|
|
Post Revision is a nice feature in WordPress 2.5 + letting you save multiple drafts of your posts. This is particularly useful if your blog has got different authors editing the same posts, or if you are so inattentive to delete important paragraph from your articles. Basically, the Post Revision feature allows you to see what was changed in a post, by whom and when, and revert it to a previous state if necessary. Now, if you are the sole author blogger in your website, this feature may be not that useful. Let’s learn how to make your database more efficent by disabling or limiting it!
You might think: “What the heck does my database have to do with Post Revision?”. Simple, every time a post is edited, this little function adds a new row in the wp_posts table of your database ending up with clogging it. So, if for example, you edit a post 10 times, you will have 10 new rows in wp_posts table! Here are some hacks to limit or disable it.
Clean your database
This is the first step to do if you want to get rid of all the junk Post Revision pestered your database with. To do it, simply go to your Cpanel, click phpMyAdmin and run this query:
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’
Note that, despite this query has never, ever troubled anybody, it is always advisable to back-up your database first.
Disable Post Revision
To do it, simple login your FTP server, go to public_html and add the following line to wp-config.php, also making sure to place it between “<?php” and “?>”:
/ /disable the painful post revision feature
define(‘WP_POST_REVISIONS’,false);
Limit Post Revision
Again, login your FTP server, go to the public_html folder and add the following line to wp-config.php, also making sure to place it between “<?php” and “?>”:
/ /disable the painful post revision feature
define(‘WP_POST_REVISIONS’,6);
The example above limit the number of Post Revision to six.
Incredibly to say, these hacks managed to improve my database a lot, also reducing the number of slow queries it produced. Before applying these tricks my database was about 2000 Kb. After using the Clean your Database hack, it was only 1046 Kb!
Tags: hack, Wordpress
Related Articles
Latest Articles
If you can not find what you are looking for, you might want to try Google Advanced Search and get thousands of results, specifically selected for you.
Google Advanced Search
|
Leave a Comment
Incoming Search Terms for the Article:
limit post revision -Best screen resolution 1280x800 or higher.
Web Talk is best viewed in Firefox.

Comments
How to fix “Windows Explorer has stopped working” in Windows 7: Thesres no machine throttling!! How do i...
An Incredible Way to Reveal Passwords Behind Asterisks: good for finding someone elses password i guess, lol
An Incredible Way to Reveal Passwords Behind Asterisks: using the browser’s saved password viewer will sometimes...
An Incredible Way to Reveal Passwords Behind Asterisks: or you could just go to tools>options>security&g t;saved...
An Incredible Way to Reveal Passwords Behind Asterisks: this should be fun at work and on public work stations. This...
An Incredible Way to Reveal Passwords Behind Asterisks: Firefox users should install this add on…....
An Incredible Way to Reveal Passwords Behind Asterisks: Note this only works if you did in fact have your browser remember...
An Incredible Way to Reveal Passwords Behind Asterisks: Nice code, useful, does it work after cleaning internet browsers...
An Incredible Way to Reveal Passwords Behind Asterisks: (“There are no passwords in forms on this page.”)
An Incredible Way to Reveal Passwords Behind Asterisks: Thanks. Doesn’t seems to be working correctly in IE6. 1....