From 215fb7ff0b6c893c6740dcb27875a3ebd13d53ed Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Thu, 28 Apr 2022 08:37:59 -0600
Subject: [PATCH] Ignore sticky posts by default in post sitemaps.

---
 src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
index 61dffdbd79..b9f2fd3185 100644
--- a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
+++ b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
@@ -219,6 +219,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
 				'no_found_rows'          => true,
 				'update_post_term_cache' => false,
 				'update_post_meta_cache' => false,
+				'ignore_sticky_posts'    => true, // sticky posts will still appear, but they won't be moved to the front.
 			),
 			$post_type
 		);
-- 
2.30.2.windows.1

