{"id":201,"date":"2012-02-16T08:00:34","date_gmt":"2012-02-16T08:00:34","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=201"},"modified":"2012-02-13T08:08:05","modified_gmt":"2012-02-13T08:08:05","slug":"remove-wordpress-revisions","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/remove-wordpress-revisions\/","title":{"rendered":"Remove WordPress Revisions"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"25\" data-permalink=\"https:\/\/pixert.com\/blog\/how-to-upgrade-wordpress\/wordpresslogo\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" data-orig-size=\"498,113\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"WordPress &#8211; the logo\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=300%2C68&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=300%2C68\" alt=\"\" title=\"WordPress - the logo\" width=\"300\" height=\"68\" class=\"aligncenter size-medium wp-image-25\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?resize=300%2C68&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?w=498&amp;ssl=1 498w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong><a title=\"The Basic of WordPress Revisions\" href=\"http:\/\/pixert.com\/blog\/the-basic-of-wordpress-post-revisions\/\">WordPress Posts Revisions<\/a><\/strong> are useful especially in the case of a multi author blog. However, There is a cost to having all these saved revisions of your posts in the aspect of database entries. Instead of having a single MySQL database record for your post you will have multiple records for each post therefore increasing the total amount of records and an increase to the total MySQL database.This in total could slow down the overall page loading speed of your WordPress blog.<\/p>\n<p>The best way to remove WordPress Revisions is to <strong><em>run an SQL database query through phpMyAdmin<\/em><\/strong>. This is quite an advanced topic so please be sure to BACKUP your database PRIOR to running any queries against your database.<\/p>\n<p>Step 1: Backup your database<br \/>\nStep 2: Log into your phpMyAdmin panel<br \/>\nStep 3: Choose the WordPress Database from the left sidebar<br \/>\nStep 4: Click on the SQL tab which should bring you to a page with the SQL query box<\/p>\n<p><strong>To view how many post revisions are stored in your WordPress database run the following query.<\/strong><\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">SELECT * FROM wp_posts LEFT JOIN wp_term_relationships ON ( wp_posts.id = wp_term_relationships.object_id ) LEFT JOIN wp_postmeta ON ( wp_posts.id = wp_postmeta.post_id ) WHERE wp_posts.post_type = 'revision';<\/pre>\n<p>What this query does is checks the wp_posts database table as well as the relationships on the wp_term_relationships &amp; wp_post_meta tables.<\/p>\n<p><strong>Remove WordPress Revisions<\/strong><br \/>\nThe code bellow will delete all the post revisions and all the data associated with the post revisions.<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">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'<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress Posts Revisions are useful especially in the case of a multi author blog. However, There is a cost to having all these saved revisions of your posts in the aspect of database entries. Instead of having a single MySQL database record for your post you will have multiple records for each post therefore increasing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[55,6,7],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-code-snippet-2","tag-wordpress-2","tag-wp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-3f","jetpack-related-posts":[{"id":198,"url":"https:\/\/pixert.com\/blog\/the-basic-of-wordpress-post-revisions\/","url_meta":{"origin":201,"position":0},"title":"The Basic of WordPress Post Revisions","author":"Pixel Insert \/ Pixert","date":"February 12, 2012","format":false,"excerpt":"WordPress has built in feature that automatically saves versions or revisions of your posts as you edit and create them. WordPress, by default, will save copies of each edit made to a post or page, allowing the possibility of reverting to a previous version of that post or page. The\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":157,"url":"https:\/\/pixert.com\/blog\/wordpress-database-optimization\/","url_meta":{"origin":201,"position":1},"title":"WordPress Database Optimization","author":"Pixel Insert \/ Pixert","date":"December 9, 2011","format":false,"excerpt":"WordPress is powered by PHP and depends on MySQL database; in fact, all the content, including the website settings, are stored in it. When your WordPress site is visited, the web server will query the database to retrieve all the necessary information to display. However, over time, the speed required\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/wpoptimize.jpg?fit=1009%2C895&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/wpoptimize.jpg?fit=1009%2C895&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/wpoptimize.jpg?fit=1009%2C895&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/wpoptimize.jpg?fit=1009%2C895&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":252,"url":"https:\/\/pixert.com\/blog\/wordpress-backup-plugins-and-services\/","url_meta":{"origin":201,"position":2},"title":"WordPress Backup Plugins and Services","author":"Pixel Insert \/ Pixert","date":"June 21, 2012","format":false,"excerpt":"Regular backup of your site will make you fill safer than any other above. Backup is a must if you have had put a lot of work and energy to your site. It takes a lot of time to fix your site after attack without backup. Few ways to backup\u2026","rel":"","context":"In &quot;Web Apps&quot;","block_context":{"text":"Web Apps","link":"https:\/\/pixert.com\/blog\/category\/web-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2012\/06\/backupbuddy-300x125.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":98,"url":"https:\/\/pixert.com\/blog\/wordpress-which-privileges-are-needed-by-mysql-database-user\/","url_meta":{"origin":201,"position":3},"title":"WordPress: Which privileges are needed by MySQL Database User","author":"Pixel Insert \/ Pixert","date":"May 2, 2011","format":false,"excerpt":"The famous 5 minutes installation for WordPress state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it Most installation instruction for WordPress on the web state that you can GRANT ALL PRIVILEGES to that\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/pixert.com\/blog\/category\/cpanel\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/05\/mysqlwp.jpg?fit=523%2C368&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":166,"url":"https:\/\/pixert.com\/blog\/output-the-number-of-wordpress-database-queries\/","url_meta":{"origin":201,"position":4},"title":"Output the number of WordPress Database Queries","author":"Pixel Insert \/ Pixert","date":"December 8, 2011","format":false,"excerpt":"The number of database queries a webpage makes to load the page have an effect on the page load time. You can use the following piece of code in the footer of your theme to find out how many database queries a page is making or WordPress query outputs and\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":170,"url":"https:\/\/pixert.com\/blog\/repair-wordpress-database\/","url_meta":{"origin":201,"position":5},"title":"Repair WordPress Database","author":"Pixel Insert \/ Pixert","date":"December 10, 2011","format":false,"excerpt":"When a WordPress table crash, one symptom might be that all of your posts seem to have disappeared, or perhaps all of your drafts. You may even get a message in phpMyAdmin telling you that one of your tables haves crashed. No need to worry. Repairing tables is very easy.\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/phpmyadminrepair.jpg?fit=1064%2C640&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/phpmyadminrepair.jpg?fit=1064%2C640&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/phpmyadminrepair.jpg?fit=1064%2C640&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/phpmyadminrepair.jpg?fit=1064%2C640&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/phpmyadminrepair.jpg?fit=1064%2C640&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}