Add a custom HTML block in WordPress
You can add custom HTML to your WordPress website by using the custom HTML option within the Code block.
- Sign in to WordPress.
- On the left side-menu, select Posts or Pages.
- Hover over the post or page you want to edit and then select Edit.
- At the upper-left corner, select Toggle block inserter.
- On the left-side menu, under Text, select Code. The code block will be added to the bottom of the post or page.
- Select Code and then select Custom HTML.
- Replace Write HTML... with your HTML code snippet.
- (Optional) Move the cursor and then select Preview or HTML to switch between previewing and editing the code.
- (Optional) Select the block and then select and hold Drag to move the block around the post or page.
- Select Update.
After you see the Page updated notification at the lower-left corner, your custom HTML code is successfully added to your site.