The JSON Rich Text Editor (RTE) is a block-style editor that enables users to seamlessly add and format diverse types of content, such as text, images, and videos. Unlike traditional editors, it stores content as structured JSON blocks, providing more flexibility and ease of integration across platforms.

When an entry containing a JSON RTE field is saved, a default value is added to the entry. However, this default value is set only when the JSON RTE field is available to edit.
For example, in a long entry with many fields, if the JSON RTE field is lower down and hasn’t been rendered (i.e., you haven’t scrolled to or interacted with it), the default value won’t be added when the entry is saved.
If the RTE has not been edited yet, the field will store the following default value:
{
"uid": "<uid>",
"type": "doc",
"children": [
{
"type": "p",
"uid": "<uid>",
"children": [
{
"text": ""
}
]
}
]
}To determine whether the JSON RTE field is truly empty and avoid unnecessary paragraph (<p>) tags, use the following condition in your implementation:
if (
entry?.json_rte?.children?.[0]?.children?.[0]?.text === "" &&
entry?.json_rte?.children?.length === 1 &&
entry?.json_rte?.children?.[0]?.children?.length === 1
) {
console.log("JSON RTE field is empty");
}This ensures that you do not mistakenly process empty values as valid content.
Learn how to efficiently work with the JSON Rich Text Editor by watching the tutorial video below.