Hook into wp_insert_post
, check if it is an auto-draft for a page, and set the comment_status
to closed
:
add_action( 'wp_insert_post', 't5_disable_default_comments_on_pages', 10, 2 );
function t5_disable_default_comments_on_pages( $post_ID, $post )
{
remove_filter( current_filter(), __FUNCTION__ );
if ( 'auto-draft' !== $post->post_status or 'page' !== $post->post_type )
return;
$post->comment_status="closed";
wp_update_post( $post );
}