how disable comments on wordpress pages

We strongly recommend to disable comments on wordpress pages. Many people want to disable the page comments. Using our code disable comments for your pages. Many people want to disable the page comments. Using simple code you can easily disable the comments for your pages by default.

how disable comments on wordpress pages

Here I written simple code. Using following code you can disable the comments for your wordpress pages. you need to just put following code into your functions.php file.

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php

function disable_comments( $posts ) {
 if ( is_page()) {
 $posts[0]->comment_status = 'disabled';
 $posts[0]->ping_status = 'disabled';
 }
return $posts;
}
add_filter( 'the_posts', 'disable_comments' );
?>
how disable comments on wordpress pages

how disable comments on wordpress pages

Add a Comment

Your email address will not be published. Required fields are marked *