This tutorial will guide you how to directly add HTML code to a WordPress post or page. Depending on the HTML editor that you use, the method will be different. In WordPress Block Editor, to directly add HTML code, add a Custom HTML block, then add your HTML code.WordPress Block Editor
WordPress Classic Editor
In WordPress Classic Editor, switch to the Text tab, then enter your HTML code:
Elementor
In Elementor builder, add an HTML element, then add your HTML code:
Divi Editor
In Divi editor, add a Text module, then switch to the Text tab in the editor and add the HTML code.
WPBakery Page Builder
In WPBakery Page Builder, you can add a Raw HTML block, then add the HTML code.
How do I add custom HTML code to WordPress?
Add a Custom HTML block in WordPress.
Open the block editor (Need help opening the block editor?)..
Select Add block..
Select Custom HTML from the Formatting section..
Paste your HTML code snippet into the field provided..
You can preview the code by selecting the Preview tab..
How do I enable HTML in WordPress?
Step 1: Log into your WordPress dashboard and navigate to the page or post you want to modify. Step 2: On the top-right corner, select the three dots which gives you More Tools & Options. Step 3: Select 'Code Editor' and you'll see that your entire post is now converted to HTML.