[resolved] How to remove comment form? (6 posts)

  1. Miss Bee
    Posted 2 years ago #

    First, huge thanks to Caroline for this fab theme! I'm using it for my wedding website and it looks great.

    However, I'd like to remove the comment form template from the pages (I'm not using it as a blog).

    I've disallowed comments in my account options and I've fiddled around with the code to try to remove it that way.

    I did manage to get rid of it, but at th cost of messing up the entire page!

    So, please can anyone let me know what I need to change/edit to remove the comment form?

    Thanks very much!

  2. Tara
    Volunteer Moderator
    Posted 2 years ago #

    try adding this snippet to your theme's functions.php:

    // Removes from post and pages
    add_action('init', 'remove_comment_support', 100);
    function remove_comment_support() {
        remove_post_type_support( 'post', 'comments' );
        remove_post_type_support( 'page', 'comments' );
  3. Caroline Moore
    Theme Author

    Posted 2 years ago #

    You should be able to do this by closing comments on all your already-published posts and/or pages.

    Disabling comments in Settings -> Discussion disables them for all future posts and pages, not current ones. You do that individually, editing each page and unchecking the "Allow comments" box.

    If you do add the above code, I would do so in a child theme so it doesn't get overwritten by future theme updates.

    Good luck (and congratulations!)

  4. Miss Bee
    Posted 2 years ago #

    Hi t-p, Caroline

    Thanks for your help!

    I used Caroline's suggestion as it was the safest, rather than me tinkering with code. WordPress does hide that box though, doesn't it?

    Thank you again!

  5. Tara
    Volunteer Moderator
    Posted 2 years ago #

    Once you disable comments in seetings,it shouldhide the comment box.

  6. massol507
    Posted 1 year ago #

    Please follow my tutorial

    http://massol507.wordpress.com/2011/07/27/menghilangkan-form-komentar-di-halaman-page-wordpress/ (in bahasa Indonesia :)

    but the script would be different if different theme

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic