Disable or Disallow Comments in WordPress

Home/Uncategorized, Wordpress tricks/Disable or Disallow Comments in WordPress

Disable or Disallow Comments in WordPress

You can disable comments in wordpress easily. The trick is to go to Settings -> Discussion -> then uncheck option “Allow people to post comments on new articles”

This setting applies to all new posts that will be published from now onwards. To disable comments from posts that have been published.

Posts -> select all then click “Edit” under bulk actions and click apply >> choose “do not allow” next to comments and hit update posts.

If you don’t want the comment form to show on any post or pages then locate all occurrences of the code below and remove it.


<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

I you don’t want the text “Comments off” to be displayed then look for wp-icludes/comment-template.php and open it in a notepad. Change the line


function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' )

to


//change $none = 'Comments Off' to $none = ''
function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = '' )

Yumna Tatheer

Yamna Tatheer is a WordPress Plugin developer and a Top-Rated Upwork professional. She is a part-time blogger from Lahore and loves to write about wordpress and freelance industry.

More Posts

Follow Me:
Facebook

About the Author:

Yamna Tatheer is a Wordpress Plugin developer and a Top-Rated Upwork professional. She is a part-time blogger from Lahore and loves to write about wordpress and freelance industry.

Leave A Comment