[wp-trac] [WordPress Trac] #50910: 5.5 Sitemap URLs are incorrectly paginated
WordPress Trac
noreply at wordpress.org
Wed Aug 12 07:19:28 UTC 2020
#50910: 5.5 Sitemap URLs are incorrectly paginated
-----------------------------+------------------------------
Reporter: jonathanstegall | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version: 5.5
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by GamerZ):
I am having the same issue. I found the cause which is Line 475 to Line
477 of wp-includes/canonical.php
As after removing the lines it works
{{{#!php
if ( $paged > 1 ) {
$addl_path .= user_trailingslashit(
"$wp_rewrite->pagination_base/$paged", 'paged' );
}
}}}
OR you can solve it with filter (but I think it should be fix in core
{{{#!php
<?php
function lesterchan_redirect_canonical( string $redirect_url, string
$requested_url ) {
if ( strpos( $requested_url, 'wp-sitemap' ) !== false ) {
return $requested_url;
}
return $redirect_url;
}
add_filter( 'redirect_canonical', 'lesterchan_redirect_canonical', 10, 2
);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50910#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list