WordPress.org

Ready to get started?Download WordPress

Forums

Turn page comments off by default 3.1.1 (14 posts)

  1. AardvarkGirl
    Member
    Posted 3 years ago #

    I just realized that this has changed since version 3.5 to now :)

    Did search this question on the forums but got dated info.

    Is there a way to turn page comments OFF by default (VS creating pages and having to remember to turn it off) without ripping this out? <?php comments_template( '', true ); ?>

    ;-)

    Love yall! :) (ok yes, I'm sucking up, hehe)

  2. Tara
    Member
    Posted 3 years ago #

    Disallow comments on specific page:

    IN the Dashboard,

    - in the 'screen option' dropdown field, there are tickboxes to show the 'discussion' box for the page;
    - in the 'discussion' box below the page editor, you can then allow/disallow comments for the page.

  3. AardvarkGirl
    Member
    Posted 3 years ago #

    Uh... thanks for the reply but, I did say I knew how to turn it off on a page by page basis. What I was asking was how to turn it OFF ON PAGES BY DEFAULT, not on a page by page basis.

  4. inspiredmind
    Member
    Posted 2 years ago #

    Hi there…
    Did you ever figure this out?
    I find it astounding that after so many years of people using hacks and so on for this simple "feature" it is still not included in WP… even at 3.1.x

    Would love to know how to do this… a plugin perhaps?

  5. inspiredmind
    Member
    Posted 2 years ago #

    Perhaps this will work?
    http://wordpress.org/extend/plugins/page-comments-off-please/

    It says only working up to 3.0.x but I'll give it a try anyway...

  6. inspiredmind
    Member
    Posted 2 years ago #

    FYI: That plugin is working on my 3.1.2 site

  7. AardvarkGirl
    Member
    Posted 2 years ago #

    I'd rather not use a plug-in. I'm just thinking that SOME WHERE in the code there is something that puts the check mark in the 'allow comments' box... the same some where to turn it off?

  8. appleisle
    Member
    Posted 2 years ago #

    I have just searched so many posts about this very issue, PLEASE can it be coded into WP - just a simple default "turn off comments on pages"?

    After all Wp is fast becoming a major CMS website design tool - we want efficiencies.

    - I totally support "inspiredminds comment 6 months ago "I find it astounding that after so many years of people using hacks and so on for this simple "feature" it is still not included in WP… even at 3.1.x"

    Working in hope!! Dennis

  9. Tara
    Member
    Posted 2 years ago #

    The folowing code should set pages and some custom post types to have commenting 'off' by default, while posts will still use the default option (i.e. commenting 'on').

    Place the code in your theme's functions.php.

    function default_comments_off( $data ) {
        if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' ) {
            $data['comment_status'] = 0;
        } 
    
        return $data;
    }
    add_filter( 'wp_insert_post_data', 'default_comments_off' );
  10. appleisle
    Member
    Posted 2 years ago #

    Thanks TP,

    Thanks for the code, I'll keep that.

    Not being a code expert, as far as I understand this means your then into a maintenance issue with Theme updates/changes, if your changing functions.php - (it can't be loaded into a CHILD theme)?

    Hence, my request for a simple WP-Admin "Appearance" default control.

    Cheers Dennis

  11. WordPressThemeWithSlider
    Member
    Posted 2 years ago #

    Thanks this helps so much!

  12. inspired888
    Member
    Posted 2 years ago #

    Thanks for this workaround T-P.

    And to reiterate what Dennis has said, we'd still like this most basic of features to be implemented in a future WP release.

    I will track down where to submit this feature request, as this discussion is obviously not the place for it.

    Cheers,

    Inspired

  13. inspired888
    Member
    Posted 2 years ago #

    Here is a link to this as a feature idea for WordPress. Please vote for it, by giving it a high star rating (5 stars, ideally)

    http://wordpress.org/extend/ideas/topic/option-to-turn-off-comments-on-new-pages-andor-posts-by-default?replies=1#post-20602

  14. Tara
    Member
    Posted 2 years ago #

    You are welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic