Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Edit HTML in WordPress

This guide shows you how to see and change the HTML behind a WordPress page or post.

WordPress2 min read17 steps6 screenshots

What is HTML?

HTML is the language that builds web pages. It uses small labels called tags to say what each piece is. For example, <p> marks a paragraph and <a> marks a link. Think of HTML as the skeleton of a page.

Why does it matter?

The normal editor is like a drawing board. It is easy, but sometimes it cannot do exactly what you want. With HTML you can fix spacing, add a special link, place an embed code or clean up odd formatting. A little HTML knowledge gives you more control.

Warning: A wrong tag can break the layout of a page. Copy the old content to a text file first, or save a draft. For bigger changes, take a backup of your site.

Edit HTML in one block

  1. Log in to WordPress and open a post or page.
  2. Click the block you want to change.
  3. Click the three dots in the small toolbar above the block.
  4. Choose Edit as HTML.
  5. Change the code.
  6. Click the three dots again and choose Visual editor.

Edit HTML for the whole page

  1. Open the post or page.
  2. Click the three dots at the top right of the screen.
  3. Choose Code editor.
  4. Edit the code.
  5. Click the three dots again and choose Visual editor to go back.
    Screenshot: Click the three dots again and choose Visual editor to go back.
    Screenshot: Click the three dots again and choose Visual editor to go back.
  6. Click Update to save.

In the code editor you may see comments like <!-- wp:paragraph -->. They are markers WordPress uses to know blocks. Leave them as they are.

Screenshot: In the code editor you may see comments like <!-- wp:paragraph --> . They are markers Word

Add a custom HTML block

  1. Click the plus button to add a block.
    Screenshot: Click the plus button to add a block.
  2. Search for Custom HTML.
    Screenshot: Search for Custom HTML .
    Screenshot: Search for Custom HTML .
  3. Click it.
  4. Paste or write your HTML.
  5. Use the Preview tab to see the result.

A small example

<p>Visit our <a href="https://example.com">home page</a>.</p>

This writes a sentence with a clickable link inside it.

Classic editor

If your site uses the Classic Editor plugin, you will see two tabs, Visual and Text. Click Text to see the HTML.

Quick recap

  • HTML is the language that builds pages.
  • Use Edit as HTML for one block.
  • Use Code editor for the whole page.
  • Use a Custom HTML block for pasted code.
  • Save a draft first so you can undo mistakes.