[wp-trac] [WordPress Trac] #4647: Text in database should not be entity-encoded
WordPress Trac
noreply at wordpress.org
Thu Oct 2 12:07:21 UTC 2025
#4647: Text in database should not be entity-encoded
--------------------------+----------------------
Reporter: redsweater | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: General | Version: 2.2.1
Severity: normal | Resolution: wontfix
Keywords: needs-patch | Focuses:
--------------------------+----------------------
Comment (by everymadep):
I agree that storing entity-encoded text like & in the database can
lead to inconsistencies, especially when some fields (like Title and
Excerpt) store raw characters while others (like Category names and
post_content) store XML entities. This inconsistency makes it difficult to
predict how the data will appear when accessed through different
interfaces — particularly XML-RPC, as you mentioned.
From a data management and architectural standpoint, it does make more
sense to store the raw, unencoded text in the database and handle any
necessary entity encoding at the presentation or output level (e.g., when
rendering HTML or preparing XML). Encoding at the database level mixes
concerns and can lead to double encoding, display bugs, and added
complexity when parsing or outputting content.
I'd support standardizing this — ideally by normalizing all stored content
to raw text and letting each interface (e.g., web output, XML-RPC, REST
API) handle encoding appropriately based on its context.
Looking forward to your follow-up on how this affects the XML-RPC
interface — sounds like that could highlight the issue even more.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/4647#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list