Rich text
Rich text gives editors a small formatting editor for things like a writer bio or a book description: bold, links, headings and lists, without the full block editor. The value is stored as HTML.
Choosing the formatting
Editor features lists the formatting editors can use: bold, italic, underline, strikethrough, links, inline code, headings, bulleted and numbered lists, blockquotes, code blocks, horizontal rules and images. Turn on only what the content needs. A bio needs bold, italic and links; it doesn't need headings.
The toolbar shows only the features you've enabled. The saved HTML is also cleaned to match, so markup a disabled feature would produce is removed on save, even if it was pasted in. Turning a feature off later strips that formatting from each entry the next time it's saved.
Open links in a new tab adds target="_blank" to links editors create.
Length limits
Min length and Max length count the visible text, not the HTML tags.
Rich text or the post content?
If a post type has one main body of text, use WordPress's own content editor. Rich text is for additional formatted fields, such as a short summary next to the main content, or formatted text inside a Repeater row.
Related
- Markdown, for teams who prefer to write Markdown
- Text and Textarea, for plain text
- Code, for markup an editor should see as markup
Technical details for LLMs
- Type key:
rich_text. Settings:enable_bold,enable_italic,enable_link,enable_code,enable_heading,enable_bullet,enable_ordered,enable_blockquote(default on);enable_underline,enable_strike,enable_code_block,enable_rule,enable_image(default off);link_target_blank,placeholder,default_value(HTML),minlength/maxlength(text length). - Stored: HTML string, sanitized on every save path through
wp_kseswith an allowlist derived from the enabled features (javascript:URIs and event handlers always removed). Widen withvxframework/fieldsets/rich_text/allowed_tags. - Output: ability reads return the sanitized HTML string; PHP
\VxFramework\render_rich_text(); dynamic tags render it as HTML.