WordPress.org

Support

Support » Plugins and Hacks » Hacks » How to remove the comment form

How to remove the comment form

  • Hello
    I am trying to remove the comment form from posts or pages without any success. The concept is via a plugin’s shortcode the users could remove the comment form. Any ideas of how this could be done?

    Thanks
    Panos

Viewing 4 replies - 1 through 4 (of 4 total)
  • Depending on how your theme is coded, you shouldn’t need to use a shortcode to do this – just turn off comments on the post/page on the edit post/page screen – this will remove the comment form.

    Hello jonnyauk and thank you for your answer, unfortunately this doesn’t suit in my situation. I need to remove or disable the comment form (not the comments),only in some cases.
    Could this happen without touching any other file?

    If you turn off comments, it should remove the comment form (not the comments) – all themes are coded a bit differently though, but give it a go. If you theme is coded properly, this will remove the comment form on individual posts/pages and leave it active on others.

    This option is under the ‘discussion’ panel on your edit screen – the option is ‘allow comments’. If you can’t see the discussion panel, click on the ‘screen options’ tab on your post/page edit screen and tick the ‘discussions’ tick box to reveal it on the edit screen.

    esmi

    @esmi

    Forum Moderator

    That’s not going to work via a plugin.

    @panagiotis AngelidisL: have you looked at the comment_form() and the comment_form_comments_closed() filters?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to remove the comment form’ is closed to new replies.