WordPress 7.1 breaks native XML sitemaps -works correctly on 7.0.4
-
WordPress 7.1 breaks native XML sitemaps on Nginx reverse proxy + Apache
Environment- WordPress 7.1: affected
- WordPress 7.0.4: works correctly
- Theme: Twenty Twenty-Five
- Editor: Gutenberg / WordPress block editor
- Plugins: none
- Web server: Nginx as a reverse proxy in front of Apache
.htaccess: default WordPress rules- Native WordPress XML sitemaps enabled
- No SEO plugin or sitemap plugin is installed
Description
I have a WordPress site built entirely with the default Twenty Twenty-Five theme and Gutenberg. There are no plugins installed at all.
The site was running WordPress 7.0.4 and everything worked correctly, including the native WordPress XML sitemap.
After upgrading the exact same site to WordPress 7.1, the native XML sitemap URLs started returning HTTP 404 errors.
The problem affects the sitemap index as well as the individual sitemap.
For example:
/wp-sitemap.xmland:
/wp-sitemap-posts-page-1.xmlboth returned HTTP 404 after upgrading to WordPress 7.1.
The site uses Nginx as a reverse proxy in front of Apache. The Apache
.htaccesscontains the standard WordPress rewrite rules and has not been customized.Reproduction:
With WordPress 7.1 installed, I tested the sitemap directly from PowerShell using
curl.For example:
curl.exe -v "https://example.com/wp-sitemap.xml" -o wp-sitemap-test.xmlThe server returned:
HTTP/1.1 404 Not Foundwith:
Server: nginxI also tested:
curl.exe -v "https://example.com/wp-sitemap-posts-page-1.xml" -o pages-sitemap-test.xmlwhich also returned:
HTTP/1.1 404 Not FoundI additionally tested the sitemap query directly:
curl.exe -v "https://example.com/?sitemap=posts&sitemap-subtype=page&paged=1" -o query-sitemap-test.xmlThis also returned:
HTTP/1.1 404 Not FoundThe same behavior was reproducible repeatedly; it was not an intermittent request failure.
Control test
I then rolled WordPress back from 7.1 to WordPress 7.0.4 on the same site.No other changes were made.
Immediately after reverting to WordPress 7.0.4, the native sitemap started working again.
The following URLs worked normally again:
/wp-sitemap.xml/wp-sitemap-posts-page-1.xmlThe site and its native sitemap functionality were therefore working correctly on 7.0.4, and the problem appeared immediately after upgrading to 7.1.
I also tested different default WordPress themes, including Twenty Twenty-Four and Twenty Twenty-Five. The issue was not resolved by changing themes.
There are no plugins involved, so there is no third-party sitemap, SEO, caching, or security plugin that could be causing the problem.
Additional information
The WordPress-generated sitemap contains the expected child sitemap, and before the rollback Google Search Console reported:Couldn’t fetch
for the sitemap.
When submitting the sitemap index, Google was able to discover the three pages contained in the page sitemap, but ultimately reported that the sitemap could not be fetched.
After rolling back to WordPress 7.0.4, the sitemap immediately became accessible again.
The standard
.htaccessis:# BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPressNo custom sitemap code, SEO plugin, caching plugin, security plugin, or other plugin is installed.
Expected behavior
The native WordPress sitemap URLs should be accessible and return the generated XML sitemap, as they do on WordPress 7.0.4.Actual behavior
On WordPress 7.1, the native sitemap URLs return HTTP 404.Regression
The issue appears to be a regression introduced between WordPress 7.0.4 and WordPress 7.1.
The same site, same server environment, same theme, same
.htaccess, and no plugins works correctly on 7.0.4 and fails on 7.1.I am reporting this because the problem affects the built-in WordPress sitemap functionality and can prevent search engines from fetching the native sitemap.
You must be logged in to reply to this topic.