[wp-trac] [WordPress Trac] #57134: Custom maintenance pages are HTTP 200, not 503

WordPress Trac noreply at wordpress.org
Thu Nov 17 14:12:24 UTC 2022


#57134: Custom maintenance pages are HTTP 200, not 503
----------------------------+-----------------------------
 Reporter:  desmith         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Bootstrap/Load  |    Version:  6.1.1
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 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.)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57134>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list