diff --git src/wp-includes/post.php src/wp-includes/post.php
index 6c58c85..d2d4cb0 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -3450,7 +3450,7 @@ function wp_insert_post( $postarr, $wp_error = false ) {
 	}
 
 	if ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) {
-		$data['post_name'] = sanitize_title( $data['post_title'], $post_ID );
+		$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent );
 		$wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where );
 	}
 
@@ -3815,9 +3815,10 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
 		$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
 		$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
 
-		// Prevent post slugs that could result in URLs that conflict with date archives.
+		// Prevent new post slugs that could result in URLs that conflict with date archives.
+		$post = get_post( $post_ID );
 		$conflicts_with_date_archive = false;
-		if ( 'post' === $post_type && preg_match( '/^[0-9]+$/', $slug ) && $slug_num = intval( $slug ) ) {
+		if ( 'post' === $post_type && ( ! $post || $post->post_name !== $slug ) && preg_match( '/^[0-9]+$/', $slug ) && $slug_num = intval( $slug ) ) {
 			$permastructs   = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) );
 			$postname_index = array_search( '%postname%', $permastructs );
 
diff --git tests/phpunit/tests/post.php tests/phpunit/tests/post.php
index 2122d03..22310c0 100644
--- tests/phpunit/tests/post.php
+++ tests/phpunit/tests/post.php
@@ -412,6 +412,29 @@ class Tests_Post extends WP_UnitTestCase {
 	}
 
 	/**
+	 * @ticket 5305
+	 */
+	public function test_wp_insert_post_should_not_allow_a_bare_numeric_slug_that_might_conflict_with_a_date_archive_when_generating_from_an_empty_post_title() {
+		global $wp_rewrite;
+		$wp_rewrite->init();
+		$wp_rewrite->set_permalink_structure( '/%postname%/' );
+		$wp_rewrite->flush_rules();
+
+		$p = wp_insert_post( array(
+			'post_title' => '',
+			'post_content' => 'test',
+			'post_status' => 'publish',
+			'post_type' => 'post',
+		) );
+
+		$post = get_post( $p );
+
+		$wp_rewrite->set_permalink_structure( '' );
+
+		$this->assertEquals( "$p-2", $post->post_name );
+	}
+
+	/**
 	 * @ticket 5364
 	 */
 	function test_delete_future_post_cron() {
diff --git tests/phpunit/tests/post/wpUniquePostSlug.php tests/phpunit/tests/post/wpUniquePostSlug.php
index 3256172..a7c3060 100644
--- tests/phpunit/tests/post/wpUniquePostSlug.php
+++ tests/phpunit/tests/post/wpUniquePostSlug.php
@@ -189,6 +189,28 @@ class Tests_Post_WpUniquePostSlug extends WP_UnitTestCase {
 	/**
 	 * @ticket 5305
 	 */
+	public function test_slugs_resulting_in_permalinks_that_resemble_year_archives_should_not_be_suffixed_for_already_published_posts() {
+		global $wp_rewrite;
+		$wp_rewrite->init();
+		$wp_rewrite->set_permalink_structure( '/%postname%/' );
+		$wp_rewrite->flush_rules();
+
+		$p = $this->factory->post->create( array(
+			'post_type' => 'post',
+			'post_name' => 'foo',
+			'post_status' => 'publish',
+		) );
+
+		$found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 );
+		$this->assertEquals( '2015-2', $found );
+
+		$wp_rewrite->set_permalink_structure( '' );
+		flush_rewrite_rules();
+	}
+
+	/**
+	 * @ticket 5305
+	 */
 	public function test_yearlike_slugs_should_not_be_suffixed_if_permalink_structure_does_not_result_in_a_clash_with_year_archives() {
 		global $wp_rewrite;
 		$wp_rewrite->init();
