Index: src/wp-admin/includes/upgrade.php
===================================================================
--- src/wp-admin/includes/upgrade.php	(revision 31286)
+++ src/wp-admin/includes/upgrade.php	(working copy)
@@ -227,7 +227,8 @@
 								'post_type' => 'page',
 								'to_ping' => '',
 								'pinged' => '',
-								'post_content_filtered' => ''
+								'post_content_filtered' => '',
+								'comment_status' => 'closed',
 								));
 	$wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );
 
Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 31286)
+++ src/wp-includes/post.php	(working copy)
@@ -3088,6 +3088,10 @@
 		'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0,
 		'post_content' => '', 'post_title' => '', 'context' => '');
 
+	if ( !empty( $postarr['post_type'] ) && $postarr['post_type'] == 'page' ) {
+		$defaults['ping_status'] = 'closed';
+	}
+
 	$postarr = wp_parse_args($postarr, $defaults);
 
 	unset( $postarr[ 'filter' ] );
@@ -3258,7 +3262,7 @@
 	}
 
 	if ( empty( $postarr['comment_status'] ) ) {
-		if ( $update ) {
+		if ( $update || $post_type == 'page' ) {
 			$comment_status = 'closed';
 		} else {
 			$comment_status = get_option('default_comment_status');
Index: tests/phpunit/tests/post.php
===================================================================
--- tests/phpunit/tests/post.php	(revision 31286)
+++ tests/phpunit/tests/post.php	(working copy)
@@ -1068,4 +1068,20 @@
 			$this->assertEquals( $post->$field, $value );
 		}
 	}
+
+	/**
+	 * @ticket 31168
+	 */
+	function test_wp_insert_post_page_default_comment_ping_status() {
+		$args = array(
+			'post_type' => 'page',
+			'post_title' => 'Example Page',
+			'post_status' => 'publish',
+		);
+		$post_id = $this->factory->post->create( $args );
+		$page = get_post( $post_id );
+
+		$this->assertEquals( 'closed', $page->comment_status );
+		$this->assertEquals( 'closed', $page->ping_status );
+	}
 }
