I'm trying to clean up a database in order to move a website from a server to another. Database is more than 1gb, mostly posts revisions and spam comments.

Is it safe for instance to do something like this?

DELETE FROM wp_2_posts WHERE post_name LIKE '%revision%'


  • 3
    On a side-note, you can limit the number of revisions WordPress stores by adding this to the wp-config.php file: define( 'WP_POST_REVISIONS', 3 ); - Read More in The Codex
    – Howdy_McGee
    Apr 28, 2015 at 17:01

1 Answer 1


Yes, it is safe but always prefer a database backup before. You can also try the Minimise WordPress DB queries to clean more.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.