{"id":188,"date":"2008-07-17T00:29:26","date_gmt":"2008-07-16T16:29:26","guid":{"rendered":"http:\/\/lesterchan.net\/wordpress\/?p=188"},"modified":"2013-09-08T00:48:51","modified_gmt":"2013-09-07T16:48:51","slug":"how-to-turn-off-post-revision-in-wordpress-26","status":"publish","type":"post","link":"https:\/\/lesterchan.net\/wordpress\/2008\/07\/17\/how-to-turn-off-post-revision-in-wordpress-26\/","title":{"rendered":"How To Turn Off Post Revision In WordPress 2.6"},"content":{"rendered":"<p>One of the irritating feature for me in WordPress 2.6 is the post revision. I am the only author of my blog and hence this feature is useless to me.<\/p>\n<p>Just in case you are wondering how post revision works, whenever a post is edited, <strong>a new row<\/strong> will be created in wp_posts table. Hence if your posts or pages got edited  10 times, you will have 10 new rows in wp_posts table.<\/p>\n<p><strong>In no time<\/strong> your wp_posts table will be filled up and the post ID will be huge.<\/p>\n<p>To turn off this feature, add this following code to <strong>wp-config.php<\/strong>:<\/p>\n<pre lang=\"php\" line=\"1\">\r\ndefine('WP_POST_REVISIONS', false);\r\n<\/pre>\n<p><del datetime=\"2013-09-07T16:44:20+00:00\">You can also delete all post revisions by running this query in phpMyAdmin:<\/del><\/p>\n<pre lang=\"sql\" line=\"1\">\r\nDELETE a,b,c  \r\nFROM wp_posts a  \r\nLEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)  \r\nLEFT JOIN wp_postmeta c ON (a.ID = c.post_id)  \r\nWHERE a.post_type = 'revision'  \r\n<\/pre>\n<p>Be sure to backup your database first before performing any queries in phpMyAdmin.<\/p>\n<p>*UPDATE* Auto Saves does not create a revision of the post.<\/p>\n<p>*UPDATE 2* Updated SQL query from <a href=\"http:\/\/andreineculau.com\/blog\/2008\/07\/delete-wordpress-26-revisions\/\">Andrei Neculau<\/a> as the previous query does not delete from wp_postmeta and wp_term_relationships tables.<\/p>\n<p>*UPDATE 3* There is a proper way of cleaning up Post Revisions as mentioned by kitchin in <a href=\"http:\/\/wordpress.org\/support\/topic\/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere?replies=3\">Deleting Post Revisions: do NOT use the a,b,c JOIN code you see everywhere<\/a>. I like his method more than the SQL query above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the irritating feature for me in WordPress 2.6 is the post revision. I am the only author of my blog and hence this feature is useless to me. Just in case you are wondering how post revision works, whenever a post is edited, a new row will be created in wp_posts table. Hence &hellip; <a href=\"https:\/\/lesterchan.net\/wordpress\/2008\/07\/17\/how-to-turn-off-post-revision-in-wordpress-26\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Turn Off Post Revision In WordPress 2.6&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[88,87,86],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-disable","tag-off","tag-revision"],"views":138642,"_links":{"self":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":0,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"wp:attachment":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}