How to use “TRUNCATE TABLE” MySQL statement?

As try today, truncate is WAY BETTER that DELETE, because DELETE broke the site, and trucate just empty the table, here is the working code :

global $wpdb;

$wpdb->query('TRUNCATE TABLE wp_posts');

Leave a Comment