Skip to content

Instantly share code, notes, and snippets.

@tahirtaous
Last active August 29, 2015 14:13
Show Gist options
  • Save tahirtaous/a3f5ec6688d5ca164548 to your computer and use it in GitHub Desktop.
Save tahirtaous/a3f5ec6688d5ca164548 to your computer and use it in GitHub Desktop.
Delete WordPress post revisions without plug in with this Native function
// 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'
" );
@tahirtaous
Copy link
Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment