If you want to upload an HTML file to WordPress, you have four realistic paths: drop it in the Media Library, push it into your site’s root folder over SFTP or File Manager, paste the markup into a Custom HTML block, or use an import plugin. Which one you pick depends on whether you’re publishing a single standalone page, adding a snippet, or moving an entire static site into WordPress. This guide walks through each method, then covers the part most tutorials skip: what breaks after the upload.
The Short Answer
For a single standalone page (a landing page, a verification file, a legacy design you want to keep live), upload the HTML file through Media > Add New or via SFTP into a subfolder of your web root. For code you want inside an existing post or page, use the Custom HTML block in the block editor instead. Full HTML websites need conversion, not an upload.
One thing to check before you start: your user role. Only administrators on a single-site install can upload .htm and .html files by default, and on multisite that permission is limited to super admins.
Method 1: Upload an HTML File Through the Media Library
This is the fastest route and it works on most standard installs. WordPress includes text/html in its default list of permitted MIME types, so the upload usually goes through without any extra configuration.
- Go to Media > Add New Media File in your WordPress dashboard.
- Drag your
.htmlfile into the upload area, or click Select Files. - Once it finishes, open the file’s details and copy the File URL.
- Visit that URL in a new tab. You should see your page render, served from
/wp-content/uploads/2026/01/yourfile.html.
Two caveats worth knowing. The page renders completely outside your theme, so no header, footer, menu or theme CSS will appear. And if the file references images or stylesheets with relative paths like images/logo.png, those assets need to sit in the same uploads folder or the links break.
If WordPress Rejects the File
Seeing “Sorry, this file type is not permitted for security reasons”? That message usually comes from your host or a security plugin, not from WordPress core. Managed hosts often block HTML uploads because a malicious .html file can be used for phishing pages hosted on your domain.
You can add define('ALLOW_UNFILTERED_UPLOADS', true); to wp-config.php, but we’d treat that as a temporary measure and remove it afterward. A cleaner fix is asking support to whitelist the extension for your account. The official WordPress documentation on uploading files lists which types are allowed out of the box.
Method 2: Upload via SFTP or Your Host’s File Manager
Putting the file directly in your web root gives you a clean URL like yoursite.com/promo/ instead of a long uploads path. This is also the method to use when you’re uploading HTML and CSS together, since you can preserve the original folder structure.
- Connect to your server with an SFTP client (FileZilla, Cyberduck) or open File Manager in your hosting dashboard.
- Navigate to the root directory, usually
public_htmlorwww, wherewp-config.phpandwp-contentlive. - Create a new folder, for example
promo, and upload your HTML file plus itscss,jsand image folders inside it. - Rename the main file to
index.htmlso the folder loads on its own. - Test
yoursite.com/promo/in a private browser window.
Never overwrite the index.php in your root directory. If you drop an index.html at the top level, most server configurations will serve it before WordPress and your entire site will appear to vanish.
This approach is also how you handle a Google Search Console HTML verification file. Google’s site verification instructions ask you to place the file in the root and leave it there permanently.
Method 3: Add HTML Code Inside a Post or Page
Most people searching for how to put HTML in WordPress don’t actually need a file upload at all. They want an embed code, a custom form, or a table inside an existing page.
- Custom HTML block: in the block editor, click the plus icon, search “Custom HTML”, then paste your markup. The Preview tab shows how it will render before you publish.
- Code editor view: press Ctrl+Shift+Alt+M (Cmd on Mac) to switch the whole editor to raw markup, useful for editing block comments directly.
- Elementor: drag in the HTML widget and paste your code in the left panel. It behaves the same way as a Custom HTML block but respects your section layout.
- Site-wide scripts: use a header and footer plugin or your theme’s hooks rather than pasting analytics tags into individual pages.
WordPress strips certain tags from Custom HTML blocks for users without the unfiltered_html capability, so editors and authors may see their <script> or <iframe> tags disappear on save. Administrators on single-site installs keep that capability.
Method 4: Use an HTML Import Plugin
If you have dozens of static pages to bring across, doing it by hand gets tedious. An HTML import plugin reads a folder of files and creates matching WordPress posts or pages, mapping the title, body content and slug automatically.
Free tools like HTML Import 2 and various HTML to WordPress converter services handle the bulk work, though results vary. Expect to spend roughly 5 to 15 minutes per page cleaning up formatting, fixing internal links and re-uploading images afterward. For a 40 page brochure site, that’s realistically a full day of work.
Method 5: Convert a Full HTML Site to WordPress
You can’t upload an entire HTML website and have WordPress adopt it. Converting means rebuilding the design as a theme so your content becomes editable. Three practical options:
- Build a custom theme: split your HTML into
header.php,index.php,footer.phpandstyle.css, then replace static text with template tags. Best fidelity, needs PHP knowledge. - Rebuild with a page builder: recreate the layout in Elementor, Bricks or the block editor. Slower visually but far easier to maintain later.
- Use a child theme on a framework: start from a lightweight parent theme and restyle it to match. A good middle ground for most small business sites.
Whichever route you take, keep your original files backed up until the new version is live and indexed. If you’re migrating a content-heavy publication, our WordPress magazine hosting setup handles the traffic spikes that come with republished archives.
What Breaks After You Upload (And How to Fix It)
This is the part competitors gloss over. Getting the file onto the server is step 1; keeping it working is step 2.
- Mixed content warnings: old HTML often hardcodes
http://asset URLs, which browsers block on an SSL site. Search and replace them with protocol-relative orhttps://paths. - Caching: static files in your root may sit outside your page cache rules. Check your LiteSpeed Cache settings if edits don’t appear.
- Duplicate content: a standalone HTML page can compete with a WordPress page targeting the same terms. Add a canonical tag or a
noindexmeta tag if it’s not meant to rank. - Broken fonts: web fonts referenced by relative path frequently 404 after a move. Our guide on uploading a font in WordPress covers the correct paths.
- Security scans: some malware scanners flag any
.htmlfile in uploads. Document what you added so you don’t panic later.
Standalone HTML pages also bypass your membership or access rules entirely. If you gate content, a file sitting in the uploads folder is publicly readable by anyone with the URL, which matters for membership sites and paid online course platforms.
Frequently Asked Questions
How do I import HTML into WordPress?
Use an import plugin such as HTML Import 2, which converts a folder of static files into WordPress pages in a single pass, typically at 20 to 50 files per run. For one or two pages, pasting the markup into a Custom HTML block is faster and gives you cleaner output.
How to put HTML in WordPress?
Add a Custom HTML block in the block editor, which takes about 10 seconds and supports live preview before publishing. Administrators can include scripts and iframes; lower roles have those tags stripped on save unless the capability is granted.
How do I upload an HTML file as a website?
Upload the file to a subfolder in your web root over SFTP, rename it index.html, and it loads at yourdomain.com/foldername/ within seconds of the transfer completing. Avoid placing an index.html in the root itself, because most servers will serve it ahead of WordPress and hide your site.
Can I convert HTML to WordPress?
Yes, and a typical 10 to 20 page static site takes 8 to 25 hours depending on whether you hand-code a theme or rebuild with a page builder. Free online converters can generate a starter theme, but expect to manually fix navigation, forms and responsive breakpoints. If you’re also planning to sell products, our WordPress vs WooCommerce explainer is worth reading first.
Need a Host That Doesn’t Block Your Uploads?
We give you SFTP, a file manager, staging and WordPress specialists on chat 24/7, so uploading an HTML file or converting a whole static site never turns into a support ticket standoff. Start a 14 day trial with WebVibo and move your files across with a hand from our team.