Get the free theme
View Categories

How to Edit a WordPress Page as Raw HTML

2 min read

WordPress is built around the block editor, so editing a whole page as raw HTML isn’t obvious. There are a few ways to do it, depending on how much HTML you’re writing.

For a section of a page

Add a Custom HTML block and write your markup in it. With Loupely Canvas, that block renders full width with nothing wrapped around it. This is the right tool when most of the page is normal blocks and one part is hand-written HTML.

For a whole page in HTML

The block editor does have a code view (the Options menu, then Code editor), but it shows block markup rather than a clean HTML surface, and editing a text area inside the block editor can be fragile. Loupely Canvas Pro adds Canvas Pages, a full page HTML editor that bypasses the block editor entirely. You write the page as one HTML field, and Canvas saves it as a single Custom HTML block, so it renders through the theme’s passthrough like any other Canvas page.

What the Pro editor gives you

  • Syntax highlighting, line numbers, and bracket matching.
  • An outline of the page’s sections and headings to jump around a long page.
  • Section folding, error checking, and a live preview as you type.
  • The full set of WordPress page options: status and visibility, publish date, slug, author, parent, and order.

Canvas Pages is part of Loupely Canvas Pro. For a single block of HTML inside an otherwise normal page, the free Custom HTML block is enough.

<lc-toy:blocks-vs-raw>
Heading block
Paragraph block
Columns block
Image block
Spacer block
<section class=”hours”> <h1>Open by the freight house</h1> <p>Set the clock to the 8:14.</p> </section>
12 blocks to nudge around one HTML document you control