Custom HTML – core/html

Add custom HTML code and preview it as you edit.

Use the Custom HTML block to write HTML and/or JavaScript.

Screenshot

Example

Free form HTML with your own choice of tags. A bit like the Classic editor’s Text editor.

Allows inline shortcodes ( e.g. WordPress ) and JavaScript.


Notes

  • You can’t switch to Visual but you can preview what you’ve written.
  • This is a static block not an embed. It’s categorised as an embed in case you attempt to embed something and the block editor’s embed logic doesn’t work. In which case you have to write the HTML yourself.
HTML
Preview
  • HTMLHTMLDisplay the custom HTML
  • PreviewPreviewPreview the formatted HTML
  • More optionsDisplay more options
    • Show More SettingsShow the block settings in the sidebar.
    • CopyCopy the block to the clipboard.
    • DuplicateUse Duplicate to create a copy of the block.
    • Insert AfterInsert a new block after the selected block(s).
    • Insert BeforeInsert a new block before the selected block(s).
    • Move To Use Move To to move a block. Up/Down or Left/Right
    • Edit as HTMLEdit the HTML of the block.
    • GroupTransform the selected block(s) into a group.
    • Add to Reusable blocksCreate a Reusable block.
    • Remove blockDelete the block.

Custom HTML transforms to: