---
title: "Rich Text (WYSIWYG)"
description: "The Rich Text control adds a WordPress rich text editor to a block for bold, italic and links. Print the HTML with wp_kses_post() in PHP."
url: "https://www.lazyblocks.com/docs/blocks-controls/rich-text-wysiwyg/"
lastUpdated: 2026-09-23
source: "blocks-controls/rich-text-wysiwyg.mdx"
---
# Rich Text (WYSIWYG)

Rich Text control provides a native WordPress editor interface for formatted text content. It supports basic text formatting like bold, italic, and links.

## Control Settings

The control adds no settings of its own, so the block builder shows only the [rows every control has](https://www.lazyblocks.com/docs/blocks-controls/overview/). **WPML Translation** is among them, which is not true of most controls.

To edit the value on the canvas instead of in the inspector, point a [Rich Text](https://www.lazyblocks.com/docs/blocks-code/rich-text/) component at the control from your block code. A single-line field comes from `disableLineBreaks` on that component.

## Usage

### Basic Output

```php title="PHP" /$attributes['control_name']/
<div class="content">
  <?php echo wp_kses_post( $attributes['control_name'] ); ?>
</div>
```

```hbs title="Handlebars" /{{{control_name}}}/
<div class="content">
  {{{control_name}}}
</div>
```

### Post Meta

```php title="Post Meta" /get_lzb_meta( 'control_meta_name' )/
<div class="content">
  <?php echo wp_kses_post( get_lzb_meta( 'control_meta_name' ) ); ?>
</div>
```

Use `wp_kses_post()` in PHP to safely output HTML content while preventing XSS attacks.

When using Handlebars, use triple curly brackets `{{{` and `}}}` to output HTML content properly.

## Documentation Index
> Fetch the complete documentation index at: https://www.lazyblocks.com/llms.txt
> Fetch every page in a single file at: https://www.lazyblocks.com/llms-full.txt
