1. SEJ
  2.  » 
  3. News

WordPress 5.5 Sitemap Bug Causes 404 Errors

WordPress sitemap bug discovered. Causes 404 errors in sitemap.

WordPress 5.5 Sitemap Bug Causes 404 Errors

A WordPress 5.5 sitemap bug was reported that affects some sites with native WordPress sitemaps. The bug creates non-existent XML sitemap pages. The issue has been officially confirmed.

Sitemap Pagination Bug

Screenshot of WordPress 5.5 bug report

The WordPress bug affects websites sitemaps that are generated by the WordPress core. The bug affects websites that have so many pages that they need more than one XML site map.

Continue Reading Below

According to the bug report, the sitemaps can look like this example:

“wp-sitemap-posts-post-1.xml
wp-sitemap-posts-post-2.xml
wp-sitemap-posts-post-3.xml”

But when you click on the post-2.xml or post-3.xml link to view those sitemaps, the sitemap does not exist and the server generates a 404 page not found response.

The bug report notes the following unexpected behavior:

“When I visit those URLs, they are:
wp-sitemap-posts-post-1.xml
wp-sitemap-posts-post-2.xml/page/2
wp-sitemap-posts-post-3.xml/page/3”

In the above example, clicking the “…post-2.xml” WordPress redirects the request for that URl to the non-existent URL, “…post-2.xml/page/2

The person reporting the bug also added:

“The first URL works correctly, but the last two are 404s.

This happens with no plugins activated and using the twentytwenty theme.

My setup does have “Day and name” permalinks enabled. I’m using PHP 7.3.19 and Nginx 1.19.0 in a local development environment.”

Continue Reading Below

Why Did the WordPress Sitemap Bug Happen?

As part of the development cycle, WordPress offers early release versions that the WordPress community downloads and tests.

It’s during this process that unanticipated bugs are discovered, noted, and assigned a severity level and a date for a patch to fix the issue.

Software bugs can happen when an unanticipated event, like a specific form of permalink structure, happens which then triggers the unexpected behavior.

The WordPress development team documented this patch that introduces a new WordPress function:

“Introduces the get_sitemap_url() function which is sort of equivalent to get_permalink() but for sitemaps. That new function is used in redirect_canonical().”

The official summary of the fix says:

“Sitemaps: Prevent incorrect redirection of paged sitemap requests.
Update redirect_canonical() to account for custom pagination and URL format used by sitemaps in order to follow standard practices.
Introduce the function get_sitemap_url() to simplify getting the index and provider URLs as needed.”

A WordPress function is a piece of code that creates a specific functionality. There are functions that are specific to themes, plugins and to the WordPress core.

The WordPress sitemap is a new addition to the WordPress core. So it was almost inevitable for something to have not been anticipated.

When Will WP Sitemap Pagination Bug Be Fixed?

The fix has been completed.

The patch is scheduled to be released in the WordPress 5.5.1 release candidate 1, scheduled for August 27th.

The final WordPress 5.5.1 maintenance update is scheduled for Tuesday September 1, 2020.

Citations

Sitemap Bug Ticket:
5.5 Sitemap URLs Are Incorrectly Paginated

Documentation of Code That’s Being Fixed

WordPress 5.5.1 Maintenance Release Schedule

Subscribe to SEJ

Get our daily newsletter from SEJ's Founder Loren Baker about the latest news in the industry!

Ebook

Roger Montti

Roger Montti is a search marketer with 20 years experience. He provides site audits, phone consultations and content and link ... [Read full bio]

Read the Next Article
Read the Next