WordPress.org

Ready to get started?Download WordPress

Forums

How to remove the comment form (5 posts)

  1. Panagiotis Angelidis
    Member
    Posted 9 months ago #

    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

  2. jonnyauk
    Member
    Posted 9 months ago #

    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.

  3. Panagiotis Angelidis
    Member
    Posted 9 months ago #

    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?

  4. jonnyauk
    Member
    Posted 9 months ago #

    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.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    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?

Reply

You must log in to post.

About this Topic