Use the Custom HTML block to add HTML code and preview it as you edit it. This guide will show you how to use this block to add code to your website.
Before you begin, the Custom HTML block is designed for adding supported HTML code directly to your page. If you’re looking to do something else, these guides may help:
- Add styling to your site: See Add custom CSS or Add additional CSS classes to blocks
- Embed content from another platform, like YouTube, Google Maps, or Spotify: see Embed content from other platforms. The Embed block works on all plans and supports many popular services without any custom code.
- Add code to your site’s headers: see Add code to headers
To add the Custom HTML block, follow these steps:
- Go to your site’s dashboard and select the page, post, or template you want to add the HTML to.
- Click the + block inserter icon and search for “HTML”.
- Click the Custom HTML block to add it to your content.

For more information, visit our detailed instructions on adding blocks.
Once you’ve added the block, follow these steps to add your HTML code:
- Click the “Edit HTML” button.

- Write or paste your HTML code on the left side of the editor.
- As you compose your HTML, you will see a preview of the code on the right side.
- When you’re satisfied, click the Update button to save your changes.

You will see the result of your HTML code in the editor. To make changes, click the “Edit HTML” button in the block toolbar.
HTML is a computer language that tells browsers how to display website content. WordPress.com allows the following HTML tags on all plans:
- a
- address
- abbr
- acronym
- area
- article
- aside
- b
- big
- blockquote
- br
- caption
- cite
- class
- code
- col
- del
- details
- dd
- div
- dl
- dt
- em
- figure
- figcaption
- footer
- font
- h1, h2, h3, h4, h5, h6
- header
- hgroup
- i
- img
- ins
- kbd
- li
- map
- mark
- ol
- p
- pre
- q
- rp
- rt
- rtc
- ruby
- s
- section
- small
- span
- strike
- strong
- sub
- summary
- sup
- table
- tbody
- td
- tfoot
- th
- thead
- tr
- tt
- u
- ul
- var
To add the following tags, you will need a paid plan with hosting features activated. Learn how to activate your plan’s hosting features.
embed, frame, iframe, form, input, object, textarea, script, style, link
For more information on the types of code you can add to your website, as well as alternatives when a type of code is not supported, visit our guide on adding code to your website.
If your HTML code does not appear as expected after saving, check the following common causes.
WordPress.com filters certain HTML tags for security. Tags like iframe, script, style, form, and embed require a paid plan with hosting features activated.
If your code disappears or is partially removed after you save:
- Confirm you have a paid WordPress.com plan (Personal, Premium, Business, or Commerce).
- Go to Hosting → Overview in your site’s dashboard and verify that hosting features are active. Learn how to activate your plan.
- Re-enter your code in the Custom HTML block and save again.
On a free plan, these tags are automatically removed when you save. Upgrade to any paid plan to use them.
If you want to embed content from a service like YouTube, Google Maps, Spotify, or a social media platform, use the Embed block instead. The Embed block works on all plans and does not require you to write HTML.
If you see a message that says your block contains unexpected or invalid content, the HTML in the block may be malformed or may have changed. Select Attempt Block Recovery to let the editor fix the issue automatically. If the error persists, see our guide on resolving block errors for additional options.