對於某些類型的WordPress站點,也許不需要在頁面(page)提供評論功能,那么你可以通過下面的方法,很容易就禁用或移除WordPress頁面的評論功能。
方法1:在頁面編輯界面取消該頁面的評論功能,如果頁面編輯處未找到該功能,吧頁面拉到頂部點擊右上角的顯示選項,把討論 勾選。

方法2:將下面的代碼添加到當前主題的 functions.php 文件,即可禁用所有頁面的評論功能:
//禁用頁面的評論功能 function disable_page_comments( $posts ) { if ( is_page()) { $posts[0]->comment_status = 'disabled'; $posts[0]->ping_status = 'disabled'; } return $posts; } add_filter( 'the_posts', 'disable_page_comments' );
方法3:直接打開當前主題的 page.php 文件,注銷或刪除類似下面的代碼:
<?php if (comments_open()) comments_template( '', true ); ?>
或者下面的函數、
comments_template
