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.
-
Log in to your WordPress dashboard.
-
Go to Pages → Add New.
-
Give the page a title.
-
Click the + icon to add a block.
-
Search for Custom HTML.
-
Select the Custom HTML block.
-
Paste your HTML code inside the block.
-
Click Preview to check it.
-
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.
-
Go to Media → Add New.
-
Upload your
.htmlfile.-
If upload is blocked, allow HTML file type using a plugin.
-
-
After upload, click the file.
-
Copy the file URL.
-
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.
-
Open your site files using File Manager or FTP.
-
Go to
/wp-content/themes/your-theme/. -
Create a new file, for example:
custom-page.php. -
Add this at the top:
<?php
/*
Template Name: Custom HTML Page
*/
?>
-
Paste your HTML code below it.
-
Save the file.
-
Go to Pages → Add New in WordPress.
-
On the right side, select this template.
-
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.
-
Open a post or page.
-
Click the + icon.
-
Choose Custom HTML.
-
Paste your HTML.
-
Update or publish.
This keeps everything inside WordPress editor.
Method 5: Set custom HTML page as homepage
-
Create the page using any method above.
-
Go to Settings → Reading.
-
Select A static page.
-
Choose your custom HTML page as homepage.
-
Save changes.