How to Upload an HTML File to WordPress (3 Ways That Work)
How you upload an HTML file to WordPress depends on what you want. To show some HTML inside a page, paste it into a Custom HTML block. To share a single HTML file, upload it under Media > Add Media File (Administrators and Editors on a single site). To publish a standalone HTML page with its own CSS and images, upload the files to a new folder with your host’s file manager or SFTP. That page then lives at yoursite.com/folder-name/, next to WordPress.
I tested each method on WordPress 7.1.3 on my lab site.
| What you want | Best method | Result |
|---|---|---|
| HTML code inside a post or page (a table, embed or form) | Method 1: Custom HTML block | Shows inside your theme, between other blocks |
| Share or link to one HTML file | Method 2: Media Library | A file URL in /wp-content/uploads/ |
| A complete page with its own design, CSS and images | Method 3: file manager or SFTP | A separate page at yoursite.com/folder-name/ |
| Verify your site in Google Search Console | Upload the file to your site’s root folder | yoursite.com/google123….html |
Before you upload files to your server, take a backup so you can undo mistakes. For bigger changes, try them on a staging site first.
Method 1: Add HTML to a Page With the Custom HTML Block
Use this when you have a piece of HTML, not a whole page. Edit the post or page, click the + inserter and add a Custom HTML block. In WordPress 7.1, the block shows a preview with an Edit code button:

Click Edit code to open the code editor. It has separate HTML, CSS and JavaScript tabs and a live preview. Paste your HTML, add any styles in the CSS tab, then click Update and save the page.

Paste only the part that goes inside the page, not a complete document with <html>, <head> and <body> tags. Your theme already provides those. If parts of your code, such as scripts or iframes, disappear after you save, your role probably lacks the unfiltered_html capability, which the next method explains. See the Custom HTML block documentation for more on the block.
Method 2: Upload an HTML File to the Media Library
Go to Media > Add Media File and upload the .html file like an image. On my test site, the upload worked and WordPress gave the file a URL in /wp-content/uploads/2026/10/. Some managed hosts block or force-download HTML files in the uploads folder, so open the file URL to check it:

Two limits matter:
- Only some roles can do it. WordPress allows
.htmluploads only for users with theunfiltered_htmlcapability. On a single site, that means Administrators and Editors. On multisite, only Super Admins have it, and even they must first addhtmlunder Network Admin > Settings > Upload file types. Anyone else, or a Super Admin before that setting is changed, sees “Sorry, you are not allowed to upload this file type.” Some hosts and security plugins also adddefine( 'DISALLOW_UNFILTERED_HTML', true );towp-config.php, which takes the capability away from everyone, Administrators included. That is the usual reason an Administrator still gets this error. - It’s a single file. CSS, images or scripts that the HTML links to with relative paths, such as
css/style.css, won’t load, because they aren’t next to the file. Use Method 3 for pages with their own assets.
Don’t work around the file type error by renaming the file or disabling WordPress’s upload checks. Those checks stop people uploading harmful files. Only upload HTML you wrote or trust: an HTML file in your Media Library runs on your own domain, so any scripts in it run there too.
Method 3: Publish a Standalone HTML Page Next to WordPress
This is the method for a landing page, an old static page or a design you built outside WordPress. You put the HTML file and its assets in their own folder on the server.
Step 1: Open Your Host’s File Manager
Log in to your hosting account and open File Manager (in cPanel, it’s under Files). You can also connect with an SFTP app such as FileZilla, using the SFTP details from your host.

Step 2: Create a Folder in Your Site’s Root
Open your site’s document root. For the main domain it is usually public_html, but some hosts call it htdocs, www or a folder named after your domain. It is the folder where WordPress’s index.php file sits. Click New Folder and name it after the address you want, for example spring-sale.

Pick a name that isn’t already a WordPress page slug. If a folder and a page share a name, the server loads the folder instead of WordPress, so the WordPress page at that address stops working.
Step 3: Upload the HTML File and Its Assets
Open the new folder and click Upload. Name the main file index.html so the page loads at yoursite.com/spring-sale/ without the file name. Upload the CSS, images and scripts too, keeping the same folder structure your HTML expects. If you have a ZIP of the page, upload it and use Extract, then delete the ZIP.

Step 4: Open the Page
Visit the folder’s address in a private browser window. On my test site, /spring-sale/ loaded the page and its stylesheet from css/style.css without touching WordPress:

This page doesn’t use your theme, menus or plugins, and WordPress won’t list it in your sitemap. Link to it from a WordPress page or menu so visitors and search engines can find it. If you want to edit it in WordPress later, recreate it with blocks instead.
Upload a Google Search Console Verification File
Google’s HTML file verification works for URL-prefix properties. Download the file from Search Console and upload it unchanged to your site’s root folder, usually public_html (or htdocs or www on some hosts), where WordPress’s index.php and .htaccess files are. Use your host’s file manager as in Method 3, but skip creating a new folder. Don’t use the Media Library, because it puts the file under /wp-content/uploads/, where Google won’t look for it. Open yoursite.com/google….html while logged out to check it loads, then click Verify. Keep the file in place afterwards. Domain properties need a DNS record instead, and many SEO plugins can add a verification meta tag, as shown in my guide to adding meta tags in WordPress.
Fix Common HTML Upload Errors
| Error | Likely cause | Fix |
|---|---|---|
| “Sorry, you are not allowed to upload this file type.” | Your role lacks unfiltered_html, the site disables it with DISALLOW_UNFILTERED_HTML, or on multisite html isn’t in the network’s allowed file types | Ask an Administrator, or use Method 3 |
| 404 Not Found | Wrong folder or file name in the URL | Check the exact path and capitalization, and that the file is inside the document root |
| Page loads without styles or images | Asset paths don’t match the folder structure | Keep the same relative folders, or use full URLs for assets |
| 403 Forbidden | The folder has no index.html, or file and folder permissions are wrong | Name the main file index.html. Then check that folders are 755 and files 644 (WordPress file permissions guide), or ask your host |
| A WordPress page stopped working | A folder now has the same name as the page slug | Rename the folder |
Frequently Asked Questions
Can I upload my own HTML and CSS to WordPress?
Yes. Use the Custom HTML block, which has HTML and CSS tabs in WordPress 7.1, for content inside a page. Use Method 3 for a complete page with its own stylesheet.
Where is the HTML file for a WordPress page?
There isn’t one. WordPress builds each page from the database and your theme every time it loads (caching plugins may save copies, but you don’t edit those). Files you upload yourself sit in /wp-content/uploads/ (Method 2) or in the folder you created (Method 3).
Can I convert an HTML website into WordPress?
Uploading the files keeps them as static pages that WordPress can’t edit. To manage the content in WordPress, create a page for each HTML page, paste the text into blocks or rebuild the layout with patterns, upload the images to the Media Library, then set up 301 redirects from the old URLs to the new pages.

