[wp-trac] [WordPress Trac] #49220: rel_canonical generates the wrong canonical structure for paginated pages.
WordPress Trac
noreply at wordpress.org
Fri Jan 17 18:50:59 UTC 2020
#49220: rel_canonical generates the wrong canonical structure for paginated pages.
--------------------------+------------------------------
Reporter: bradleyt | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 4.6
Severity: normal | Resolution:
Keywords: close | Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):
* keywords: needs-patch => close
Comment:
Hi there, welcome back to WordPress Trac! Thanks for the report.
This appears to be an issue with WordCamp.org's implementation of the
`rel="canonical"` tag, not WordPress core.
By default, `rel_canonical()` [source:tags/5.3/src/wp-includes/link-
template.php?marks=3808-3810#L3801 only outputs the tag for singular
queries], not for archives or paginated views.
Note that there are two formats of paginated views in core:
* `/page/2/` for archives.
* `/2/` for posts using the
[https://developer.wordpress.org/themes/functionality/pagination
/#pagination-within-a-post <!--nextpage--> tag in content].
It looks like WordCamp.org's implementation of the `rel="canonical"` tag
confuses between the two, but that's something to address on that specific
site.
Note that @iandunn's suggestion for a core ticket in #meta4564 referred to
performing a redirect for paginated archive views when the homepage is set
up to display a page, not to the `rel_canonical()` behavior.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49220#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list