SQL manipulations for WordPress comments and trackbacks

Disable comments and trackbacks globally:

UPDATE wp_posts SET comment_status = 'closed';
UPDATE wp_posts SET ping_status = 'closed';

Disable comments and trackbacks on post type:

UPDATE wp_posts SET ping_status = 'closed' WHERE post_type = 'post|page';

Disable comments and trackbacks on post status:

UPDATE wp_posts SET ping_status = 'closed' WHERE post_status = 'publish|inherit|pending|private|future|draft|trash' AND post_type = 'post';
  1. No comments yet.

  1. No trackbacks yet.