How to add a custom HTML page in WordPress?

Table of Contents

How to add a custom HTML page in WordPress

You already have an HTML file, or maybe just raw HTML code, and you want it to work inside WordPress. There are a few correct ways to do it. Pick the one that matches what you actually have.

Method 1: Add custom HTML using a WordPress page (most common)

This is for when you have HTML code, not a full .html file.

  1. Log in to your WordPress dashboard.

  2. Go to Pages → Add New.

  3. Give the page a title.

  4. Click the + icon to add a block.

  5. Search for Custom HTML.

  6. Select the Custom HTML block.

  7. Paste your HTML code inside the block.

  8. Click Preview to check it.

  9. Click Publish.

The page now loads your HTML inside WordPress.

Method 2: Upload a full HTML file and open it

Use this when you already have a .html file.

  1. Go to Media → Add New.

  2. Upload your .html file.

    • If upload is blocked, allow HTML file type using a plugin.

  3. After upload, click the file.

  4. Copy the file URL.

  5. Paste the URL in your browser to open it.

This runs the HTML file separately from WordPress pages.

Method 3: Add custom HTML using a page template (theme method)

This is useful if the page layout needs full control.

  1. Open your site files using File Manager or FTP.

  2. Go to /wp-content/themes/your-theme/.

  3. Create a new file, for example: custom-page.php.

  4. Add this at the top:

    <?php
    /*
    Template Name: Custom HTML Page
    */

    ?>
  5. Paste your HTML code below it.

  6. Save the file.

  7. Go to Pages → Add New in WordPress.

  8. On the right side, select this template.

  9. Publish the page.

This page runs your HTML directly through the theme.

Method 4: Add custom HTML inside a post or section

Good for forms, embeds, scripts, or layouts.

  1. Open a post or page.

  2. Click the + icon.

  3. Choose Custom HTML.

  4. Paste your HTML.

  5. Update or publish.

This keeps everything inside WordPress editor.

Method 5: Set custom HTML page as homepage

  1. Create the page using any method above.

  2. Go to Settings → Reading.

  3. Select A static page.

  4. Choose your custom HTML page as homepage.

  5. Save changes.

Facebook
Twitter
LinkedIn
Pinterest

Interested in website maintenance for your company.?We can help. 

RECENT FAQs