Opened 10 years ago
Last modified 18 months ago
#28081 accepted defect (bug)
Do a canonical redirect for pages when query var 'paged' is set
Reported by: | ocean90 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Canonical | Keywords: | has-patch SEO needs-unit-tests needs-refresh |
Focuses: | Cc: |
Description
Example: http://make.wordpress.org/core/features-as-plugins/page/2323/
You can append /page/{any number} to a page and still get the same content as http://make.wordpress.org/core/features-as-plugins/
The same doesn't happen for posts.
trunk/src/wp-includes/canonical.php#L274: Seems like l274 and l276 should be !is_singular() as it was before [6115]. (Block was changed in [9697].)
Want to use this ticket to get some reasons for [6115]. Currently I only can think of custom page templates which are using a custom pagination, so maybe wontfix.
Attachments (3)
Change History (57)
This ticket was mentioned in IRC in #wordpress-dev by ocean90. View the logs.
10 years ago
#3
@
10 years ago
- Keywords has-patch added; dev-feedback removed
- Milestone changed from Awaiting Review to 4.0
This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.
10 years ago
#5
@
10 years ago
- Milestone changed from 4.0 to Future Release
Seems like this needs a bit more discussion and a consensus. Punting.
#9
@
8 years ago
Leaving a note here that apparently the fix for #11694 was incomplete.
It introduced a sanity check for posts that use the <!--nextpage-->
tag, but those that don't use it are still affected: https://make.wordpress.org/core/2016/09/15/media-weekly-update-sept-9/12345/
#11
@
8 years ago
- Keywords needs-unit-tests added
- Owner set to SergeyBiryukov
- Status changed from new to accepted
This ticket was mentioned in Slack in #core by henrywright. View the logs.
7 years ago
#16
@
7 years ago
You can append /page/{any number} to a page and still get the same content as http://make.wordpress.org/core/features-as-plugins/
FYI
You can also append /{any number} to a page and still get the same content.
#17
@
7 years ago
Note that the issue I mention in #16 is not fixed by 28081.patch.
28081.patch does fix:
https://make.wordpress.org/core/features-as-plugins/page/2323/
28081.patch doesn't fix:
#18
@
7 years ago
I tested 28081.patch against a custom page template which uses pagination.
Tried visiting the following with the patch applied:
- example.com/pagename/page/2/
- example.com/pagename/page/3/
- example.com/pagename/page/4/ etc
...all have items to show but they all redirect to example.com/pagename/
As @ocean90 suggested above, custom page templates which are using pagination are a problem.
This ticket was mentioned in Slack in #forums by sergey. View the logs.
7 years ago
#23
@
7 years ago
- Keywords has-unit-tests added; needs-unit-tests removed
In 28081.diff: original patch with unit test for canonical URL against a page with the paged query var.
#24
@
7 years ago
- Milestone changed from 4.9 to Future Release
Punting as there's been no activity in several months, and any changes to canonical generally need a lot of testing for edge cases none of us expected would ever be a thing.
@SergeyBiryukov feel free to re-milestone when you commit, if you do so this release.
#27
@
7 years ago
Something I just noticed, perhaps related:
https://make.wordpress.org/core/features-as-plugins/page/123/
has <link rel="canonical" href="https://make.wordpress.org/core/features-as-plugins/" />
- duplicate content, but canonical URL is correct
vs.
https://make.wordpress.org/core/features-as-plugins/123/
has <link rel="canonical" href="https://make.wordpress.org/core/features-as-plugins/123/" />
- duplicate content with duplicate canonical URL
#28
@
7 years ago
- Keywords SEO added
@chesio yeah the first example you give is not a correct URL for a paginated version of the post, whereas the second is (even though there is of course no pagination within the post), and the canonical code doesn't handle that well.
#35
@
6 years ago
- Keywords needs-unit-tests added; has-unit-tests removed
This is some deep magic, I fell down a rabbit hole reviewing it.
Moving to 5.2. Adding many more unit tests showing that it works, and doesn't have side effects, would improve the chances of it actually landing.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
5 years ago
#38
@
5 years ago
- Keywords needs-refresh added
- Milestone changed from 5.2 to Future Release
The last patch still needs a refresh and some unit-tests. As per today's bug scrub, let's move the ticket to future release
.
#40
@
5 years ago
Related, #45337, which deals with the page
query var and a similar issue rather than the paged
query var covered by this ticket. (I think)
#47
@
4 years ago
- Milestone changed from 5.5 to 5.6
Didn't get a chance to bring this one over the finish line. Moving to 5.6, along with #50163.
This ticket was mentioned in Slack in #core by helen. View the logs.
4 years ago
#51
@
4 years ago
- Milestone changed from 5.7 to Future Release
We're too late in the release cycle for 5.7 to get this one through. Moving to Future Release.
#53
@
3 years ago
The issue is still there. I've checked in 5.8 and 5.9-RC1 versions. Such pages are returning the 200 code but at least have the correct canonical.
While testing the sites that I updating I was thinking that I have an issue with some plugin and turned out this is almost a norm ( And most inconvenient is that as a developer you are trying to clarify a problem that other developers have spent time clarifying as well.
To know the system's existing issues is a big thing as well as learning its features, abilities and API. I am suggesting establishing a 'known issues digest' to publish alongside releases with a call for contributors to solve them.
Related: #11694