wordpress.org – Allow comments box cannot be checked on *any* pages


WordPress 5.1.4 with twentynineteen theme 2.0

I Quick Edit a page and check the Allow Comments box, then click the Update button. There is no message displayed, but when I Quick Edit that page again, the box is unchecked. I saw this answer to a related question, and even though the theme does not have a similar filter, I put the following in a plugin, and activated it:

function default_comments_on( $data ) {
// Adapted from https://wordpress.stackexchange.com/a/179682/44613
if( $data['post_type'] == 'page') {
    $data['comment_status'] = 1;
return $data;
add_filter( 'wp_insert_post_data', 'default_comments_on' );

But the behavior persists. Any ideas how to fix this?

Actually, what I want to do is default all pages to allow comments, and I expected that the filter above would do that, but it doesn’t. I think it’s very odd for WordPress not to allow comments on pages by default, but I guess it’s a tradition. But working hard to prevent site admins from allowing them on specific pages seems very strange.

sootsnoot 4 months 2021-06-25T21:56:19-05:00 0 Answers 0 views 0

Leave an answer