Title: Custom HTML
Author: Antonio Villegas
Published: March 7, 2019
Last modified: May 20, 2026

---

# Custom HTML

## In this article

 * [Add a Custom HTML block](https://wordpress.org/documentation/article/custom-html/?output_format=md#add-a-custom-html-block)
 * [Editing the block](https://wordpress.org/documentation/article/custom-html/?output_format=md#editing-the-block)
 * [Block toolbar](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-toolbar)
    - [Block moving tools](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-moving-tools)
    - [Edit Code button](https://wordpress.org/documentation/article/custom-html/?output_format=md#edit-code-button)
    - [More options](https://wordpress.org/documentation/article/custom-html/?output_format=md#more-options)
 * [Block settings](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-settings-panel)
 * [Changelog](https://wordpress.org/documentation/article/custom-html/?output_format=md#changelog)

[ Back to top](https://wordpress.org/documentation/article/custom-html/?output_format=md#wp--skip-link--target)

[Go back to the list of Blocks](https://wordpress.org/documentation/article/blocks/)

**Hypertext Markup Language (HTML)**, is language used to describe the semantic 
content of web pages. This can be added using the custom HTML block. This block 
allows you to insert your code so you can fine-tune your content. 

Starting in WordPress 7.0, the Custom HTML block introduces separate editing panels
for HTML, CSS, and JavaScript. The CSS and JavaScript panels are only available 
to users with the unfiltered_html capability. If a user lacks this capability (for
example, a Contributor), WordPress will sanitize the block’s content using the function
[wp_kses()](https://developer.wordpress.org/reference/functions/wp_kses/), stripping
disallowed tags such as `<script>` and `<iframe>`. In this case, the CSS and JavaScript
panels are not shown, and any disallowed markup is removed when the post is saved
or updated.

[Learn more about WordPress user roles and capabilities](https://wordpress.org/documentation/article/roles-and-capabilities/)

## 󠀁[Add a Custom HTML block](https://wordpress.org/documentation/article/custom-html/?output_format=md#add-a-custom-html-block)󠁿

In order to add a custom HTML block, click on the **Block Inserter** icon.

You can also type `/html` and hit enter in a new paragraph block to add one quickly.

![Adding a block with a slash html command](https://wordpress.org/documentation/
files/2019/03/Screenshot-2026-05-20-at-10.56.23-AM.png)

[Detailed instructions on adding blocks](https://wordpress.org/documentation/article/adding-a-new-block/)

## 󠀁[Editing the block](https://wordpress.org/documentation/article/custom-html/?output_format=md#editing-the-block)󠁿

Once you add the block, click on the Edit HTML button to open the editing modal.

![Custom HTML block empty state showing an Edit HTML button](https://wordpress.org/
documentation/files/2019/03/html-editing-block-1024x360.png)

Enter HTML code and see the preview of your output to the right of the code editor.
You can expand the modal to fullscreen the Enable/disable fullscreen button on the
top right of the modal. When you are done entering code, press the Update button.

![Custom HTML block edit state showing the HTML code pane on the left and HTML output
preview on the right](https://wordpress.org/documentation/files/2019/03/html-edit-
modal-1024x605.png)

## 󠀁[Block toolbar](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-toolbar)󠁿

The Custom HTML block has the following options on the block toolbar:

![Custom HTML block toolbar](https://wordpress.org/documentation/files/2019/03/html-
block-toolbar.png)

### 󠀁[Block moving tools](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-moving-tools)󠁿

The block-moving tools allow you to move the block in the editor. Use the six dots
icon to drag and drop the block and place it anywhere on the page. Alternatively,
click on the up and down arrows to move the block up or down.

![Custom HTML block toolbar with block moving tools highlighted](https://wordpress.
org/documentation/files/2019/03/html-move-tools.png)

[Get more information about moving a block within the editor](https://wordpress.org/documentation/article/moving-blocks/)

### 󠀁[Edit Code button](https://wordpress.org/documentation/article/custom-html/?output_format=md#edit-code-button)󠁿

Press this button to make changes to your Custom HTML block code.

### 󠀁[More options](https://wordpress.org/documentation/article/custom-html/?output_format=md#more-options)󠁿

These controls give you the option to copy, duplicate, or rename your block.

[[[Read about these and other settings](https://wordpress.org/documentation/article/more-options/)

## 󠀁[Block settings](https://wordpress.org/documentation/article/custom-html/?output_format=md#block-settings-panel)󠁿

While most blocks have specific options in the editor sidebar in addition to the
options found in the block toolbar, the HTML block does not have extra options.

## 󠀁[Changelog](https://wordpress.org/documentation/article/custom-html/?output_format=md#changelog)󠁿

 * Updated 2026-05-20 (props to @awetz583 @atachibana )
    - Updated information, video and screenshots for 7.0
 * Updated 2026-05-01
    - Updated formatting and added link to roles and capabilities
 * Updated 2025-07-21
    - Added detail HTML processing
 * Updated 2022-11-26
    - Removed redudant content
    - Aligned images for mobile view
    - Added heading
 * Updated 2022-04-20
    - Update screenshots to 5.9
    - Add More Options section

## Was this article helpful? How could it be improved? 󠀁[Cancel reply](https://wordpress.org/documentation/article/custom-html/?output_format=md#respond)󠁿

[Log in to submit feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fdocumentation%2Farticle%2Fcustom-html%2F&locale=en_US).
If you need support with something that wasn't covered by this article, please post
your question in the [support forums](https://wordpress.org/support/forums/).

First published

March 7, 2019

Last updated

May 20, 2026