[wp-trac] [WordPress Trac] #38715: Facilitate posts storing raw JSON in post_content by short-circuiting KSES and other filters

WordPress Trac noreply at wordpress.org
Thu Dec 18 18:54:21 UTC 2025


#38715: Facilitate posts storing raw JSON in post_content by short-circuiting KSES
and other filters
-------------------------------+-----------------------------
 Reporter:  westonruter        |       Owner:  (none)
     Type:  enhancement        |      Status:  reopened
 Priority:  normal             |   Milestone:  Future Release
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+-----------------------------
Changes (by westonruter):

 * status:  closed => reopened
 * resolution:  maybelater =>
 * milestone:   => Future Release


Comment:

 I think this is still worth doing. It's something that both core and
 plugins have to work around. There are CPTs in core where I'm aware of
 KSES potentially corrupting valid `post_content`:

 1. `custom_css` which contains CSS (for which KSES can corrupt valid CSS,
 as seen in #64418).
 1. `customize_changeset` which contains JSON (which has a workaround to
 bypass KSES).
 1. `wp_global_styles` which contains JSON (which has no KSES override, but
 Additional CSS appears to be disabled if the user can't do
 `unfiltered_html`).

 See [ticket:64418#comment:16].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/38715#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list