[wp-trac] [WordPress Trac] #51912: Sitemap pages 404 with more than one page

WordPress Trac noreply at wordpress.org
Wed May 5 23:31:46 UTC 2021


#51912: Sitemap pages 404 with more than one page
--------------------------+------------------------------
 Reporter:  loranrendel   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Sitemaps      |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by peterwilsoncc):

 I think the root cause of this is #51117.

 The report in #53095 suggests this is a more serious problem for sites
 with a custom post type that contains more post objects than there are
 native WordPress `post` post objects.

 As the sitemaps execute the main (`is_home()`) query, that query is used
 to determine the the pages status. On sites with multiple pages in the
 site map, then the page parameter is passed to the `is_home` query causing
 a file not found error if the frontend would not have the same number of
 pages.

 Consider the following site:

 * 9 `post` objects
 * 3500 custom post type objects

 Page two of the CPT sitemap will 404 as there is only a single page of
 posts according the the posts per page setting in the dashboard.

 The same will apply for user and taxonomy site maps if there are more
 authors or terms than posts.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51912#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list