[wp-trac] [WordPress Trac] #64009: wp_die() status code global updates (parent ticket)
WordPress Trac
noreply at wordpress.org
Fri Sep 19 17:09:43 UTC 2025
#64009: wp_die() status code global updates (parent ticket)
--------------------------+-----------------------------
Reporter: callumbw95 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Just detailing an issue that was originally raised back in
[https://core.trac.wordpress.org/ticket/12529 #12529] where across the
code base there are multiple instances of the `wp_die()` function not
including a status code. This causes all of these function calls to be
logged as a `500` error. However as this is not always the case, this
ticket aims to resolve this historical issue within the codebase by
suggesting updated status codes for each request. As there are multiple
areas that this will cover, I have broken this down into multiple tickets
covering the various components here on trac. As of such I will create
tickets covering each of the following areas:
- **Media**: 4 files - 12 changes
- **Menus**: 3 files - 4 changes
- **Network and Sites**: 15 files - 42 changes
- **Options**: 9 files - 10 changes
- **Plugins**: 4 files - 14 changes
- **Posts, Post Types**: 6 files - 20 changes
- **REST API**: 2 files - 133 changes
- **Themes**: 3 files - 5 changes
- **Upgrade/Install**: 3 files - 26 changes
- **Users**: 4 files - 8 changes
There are also other files I have taken a look through, and I have not
categorised into components yet, so will update this ticket once I have
them ready.
In regards to each of the tickets created I will be going into a more
thorough breakdown of the function usage across each of the files. Also
please note this work does not try to change every instance of `wp_die()`,
but those that could benefit from a more apprioriate response code.
Historical tickets related to this issue:
- [https://core.trac.wordpress.org/ticket/12529 #12529] - (16 years)
Specify a response for more `wp_die` calls
- [https://core.trac.wordpress.org/ticket/47393 #47393] - (6 years)
Comment form submission with invalid fields incorrectly returns `200 OK
response`
- [https://core.trac.wordpress.org/ticket/63836 #63836] - (4 weeks) Use
more appropriate HTTP status codes for `wp_die()` calls in `wp-
admin/post.php`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64009>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list