diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index b225d35c48..e51df957b5 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -4997,7 +4997,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
 		clean_post_cache( $post_id );
 	}
 
-	if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
+	if ( is_object_in_taxonomy( $post_type, 'category' ) && ( ! $update || isset( $postarr['post_category'] ) ) ) {
 		wp_set_post_categories( $post_id, $post_category );
 	}
 
diff --git a/tests/phpunit/tests/post/wpInsertPost.php b/tests/phpunit/tests/post/wpInsertPost.php
index 1227984834..fd36f6b11a 100644
--- a/tests/phpunit/tests/post/wpInsertPost.php
+++ b/tests/phpunit/tests/post/wpInsertPost.php
@@ -1530,4 +1530,48 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase {
 
 		$this->assertSame( 'future', get_post_status( $post_id ) );
 	}
+
+	/**
+	 * Verify that updating a post without taxonomy parameters avoids unnecessary queries.
+	 *
+	 * @ticket 59354
+	 * @covers ::wp_insert_post
+	 */
+	public function test_update_post_without_taxonomy_params_skips_term_queries() {
+		$post_id = self::factory()->post->create(
+			array(
+				'post_title'    => 'Test Post',
+				'tags_input'    => array( 'tag1' ),
+				'post_category' => array( 1 ),
+			)
+		);
+
+		// Update with taxonomy params — baseline query count.
+		$queries_before = get_num_queries();
+		wp_insert_post(
+			array(
+				'ID'            => $post_id,
+				'post_title'    => 'Updated With Taxes',
+				'tags_input'    => array( 'tag1' ),
+				'post_category' => array( 1 ),
+			)
+		);
+		$queries_with_tax = get_num_queries() - $queries_before;
+
+		// Update without taxonomy params — should use fewer queries.
+		$queries_before = get_num_queries();
+		wp_insert_post(
+			array(
+				'ID'         => $post_id,
+				'post_title' => 'Updated Without Taxes',
+			)
+		);
+		$queries_without_tax = get_num_queries() - $queries_before;
+
+		$this->assertLessThan(
+			$queries_with_tax,
+			$queries_without_tax,
+			'Updating a post without taxonomy parameters should use fewer queries.'
+		);
+	}
 }
