Opened 2 years ago
Last modified 2 years ago
#57134 new defect (bug)
Custom maintenance pages are HTTP 200, not 503
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.1.1 |
Component: | Bootstrap/Load | Keywords: | |
Focuses: | Cc: |
Description
If WordPress' maintenance mode is activated (with wp maintenance-mode activate
, for instance) by default WordPress returns the content of that page with an HTTP 503 "Service Temporarily Unavailable" status code. This makes sense, because it's maintenance, and presumably temporary.
If you have created a wp-content/maintenance.php
file, though, maintenance pages displaying that content are returned as HTTP 200 OK. This could be confusing to search engines, and generally misleading.
This is happening around line 272 of wp-includes/load.php, where if a custom maintenance page is defined we simply die()
as opposed to a few lines later where we can wp_die()
and use a different HTTP status.
Is it intentional to return a different status when a custom maintenance page is defined? (If not, I'll write up a patch, it should be straightforward.)
Absolutely makes sense to send the 503 headers. We probably need to send no-cache headers as well as a
Retry-After
header to make the custom maintenance pages on par with the standard response.