[wp-trac] [WordPress Trac] #37832: Using ?p=xxx on a posts page with an invalid post ID does not return a 404 status
WordPress Trac
noreply at wordpress.org
Thu Aug 25 23:06:42 UTC 2016
#37832: Using ?p=xxx on a posts page with an invalid post ID does not return a 404
status
--------------------------+-----------------------------
Reporter: smerriman | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Steps to replicate:
- Create a page and set it as the posts page.
- Visit this page with ?p=123456 (an invalid ID) added.
WordPress will return whatever 'no results found' message you have in the
theme, but with a 200 status.
The handle_404 function seems to have been set up to always give a 200
status if is_home() returns true. This should not apply if you're
overriding the query in some way via the URL.
Somehow many of these URLs have been detected by Google on a site of ours
and are being reported as soft 404s. How they were found is one thing, but
WordPress should not be returning a 200 status regardless.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37832>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list