Opened 3 years ago
Last modified 8 months ago
#11694 accepted defect (bug)
WP should do sanity checks for paginated posts, pages and comments
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Template | Version: | 2.9 |
| Severity: | major | Keywords: | has-patch |
| Cc: | sirzooro |
Description
Create a post with two pages using the <!--nextpage--> tag. Publish, and browse the post's *third* page.
WP should return a 404 here, rather than the last page of the post.
Along the same lines, it should return the correct canonical urls for paginated posts. Currently, rel=canonical will only ever return the post's first page.
Attachments (1)
Change History (10)
- Version set to 2.9
- Summary changed from WP should do sanity check for paginated posts and pages to WP should do sanity checks for paginated posts and pages
- Keywords has-patch added
- Milestone changed from 3.0 to 3.1
- Owner set to dd32
- Status changed from new to accepted
I'm attaching a patch I've got locally for this.
This will need a more thought out patch however.
comment:6
SergeyBiryukov — 9 months ago
Closed #21278 as a duplicate. Related: #11857 (for archive pages).
As noted in ticket:21278:9, paginated comments are affected too.
See also #21579 where a similar issue occurs with paged comments. Invalid comment pages, for example http://example.com/content/comment-page-999/ do not return a 404 but equally do not find any comments! Is a new ticket needed or can we use this one to fix the 404 issue in both cases and #21579 to generate the proper rel="canonical" in both cases?
comment:9
SergeyBiryukov — 8 months ago
- Summary changed from WP should do sanity checks for paginated posts and pages to WP should do sanity checks for paginated posts, pages and comments
Replying to mdgl:
Is a new ticket needed or can we use this one to fix the 404 issue in both cases
No need for a new ticket. Updated the summary.

The rel=canonical issue really ought to be split out in to a separate bug, imho.