comments Archives - wiki

WordPress turn on comments for all posts

Turn on comments for all posts

using wordPress  query()

$sql=" UPDATE $wpdb->posts SET comment_status='open' ";

$wpdb->query($sql);

Using normal sql

UPDATE wp_posts SET comment_status='open';

Turn off comments for all posts

using wordpress query()

$sql=" UPDATE $wpdb->posts SET comment_status='close' ";

$wpdb->query($sql);

using normal sql

UPDATE wp_posts SET comment_status='close';

 

ref:

https://codex.wordpress.org/Class_Reference/wpdb

 

By bm on June 28, 2016 | wordpress | A comment?
Tags: ,