Query sql for truncate post_content in wp_posts table

  1. Backup your db
  2. Remeber to backup your db
  3. Import the backup in another database, change wp-config.php to use this new database and see if everithing is ok. (Importing is successfull? Site appear without any change?)
  4. WordPress uses a prefix for table names. The default is ‘wp_’ but clever guys change it with something else. (The change is made in wp-config.php before install WP). So in my query I will use ‘wp_’ as table prefix, replace it with your table prefix if it’s different.
  5. In the new db (the one created from backup) run this query (remember to change wp_posts if your tables has a different prefix):

    UPDATE wp_posts SET post_content = "", post_excerpt = "" WHERE post_type="post" AND post_status <> 'inherit' AND post_status <> 'trash';
    
  6. Check your site and if anything goes wrong change wp-config.php to use the original db and then investigate the problem.