Last active
August 29, 2015 14:13
-
-
Save tahirtaous/a3f5ec6688d5ca164548 to your computer and use it in GitHub Desktop.
Delete WordPress post revisions without plug in with this Native function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Open you functions.php file and paste the following code: | |
// Save the file and open your blog homepage to run the code. Once done, there’s no need to keep the code snippet in your | |
// functions.php file, as it will always delete all post revisions. So simply remove it. | |
// http://www.wprecipes.com/easily-delete-wordpress-post-revisions-using-your-fuctions-php-file | |
$wpdb->query( " | |
DELETE FROM $wpdb->posts | |
WHERE post_type = 'revision' | |
" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better Delete Revision is another free plug in
Remove and delete old revision of posts, pages and related meta content completely then optimize Database: reduce size and optimization to speed up!
https://wordpress.org/plugins/better-delete-revision/