WP eCommerce

Wordpress e-Commerce Blog and Resources for Quality eCommerce Plugins and Themes

  • Home
  • WordPress Plugins
  • Contact
  • Privacy Policy

Comments Will Be Turned Off on Pages by Default in WordPress 4.3

As of WordPress 4.3 comments will be turned off on pages by default. This new feature will greatly improve the user experience. Users won’t have to manually turn it off in the discussion settings after creating new pages.

In addition to pages, this functionality will also apply to custom post types. If you don’t add support for comments when registering a new post type, it will default to comments being off.

The new change will also come with a filter that you can use to restore the current behaviour of comments to a particular post type. For example:

/**
 * Filter whether comments are open for a given post type.
 *
 * @param string $status       Default status for the given post type,
 *                             either 'open' or 'closed'.
 * @param string $post_type    Post type. Default is `post`.
 * @param string $comment_type Type of comment. Default is `comment`.
 * @return string (Maybe) filtered default status for the given post type.
 */
function wpdocs_open_comments_for_myposttype( $status, $post_type, $comment_type ) {
    if ( 'myposttype' !== $post_type ) {
        return $status;
    }
 
    // You could be more specific here for different comment types if desired
    return 'open';
}
add_filter( 'get_default_comment_status', 'wpdocs_open_comments_for_myposttype', 10, 3 );

Related posts:

  1. Why Choose the WordPress Platform for Your Blog?

Filed Under: Wordpress

Free WordPress Plugins

  • PayPal Pro Payment Gateway for WooCommerce
  • Braintree Payment Gateway for WooCommerce
  • WordPress Recurring Donation Plugin

Featured Plugin

Copyright © 2025 | WP eCommerce