Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Developer · Info

Can You Upload HTML to WordPress? The Short Answer

Can You Upload HTML to WordPress? The Short Answer

Short answer

Yes. Paste snippets into a Custom HTML block, upload a full HTML file to your server with FTP or File Manager, or turn the design into a page template. Admins can also upload HTML files to the Media Library, though that is best for downloads.

Key takeaways

  • Use the Custom HTML block for snippets and embed codes.
  • Full HTML pages can live in a server folder beside WordPress.
  • Uploaded HTML files skip your theme, plugins and SEO settings.
  • Only users with unfiltered_html can upload HTML to the Media Library.
  • A page template lets an HTML design use your header and footer.

Can you upload HTML to WordPress?

Yes, you can add HTML to WordPress with the Custom HTML block, upload a full HTML file to your server by FTP or File Manager, or turn an HTML design into a WordPress page template.

The right method depends on what you have. A small snippet, like an embed code, belongs in a block. A complete standalone page is usually best uploaded as a file.

A whole static website is a bigger job. You can host it beside WordPress, or rebuild it inside WordPress so you can edit it from the dashboard.

Below we compare each method, explain the limits, and cover the security rules WordPress applies to HTML uploads.

Which method should you use?

Use the Custom HTML block for snippets, a file upload for a standalone page you will rarely change, and a page template or rebuild when you want the page to share your theme and be editable.

What you haveBest methodUses your themeEditable in dashboard
A snippet or embed codeCustom HTML blockYesYes
A full page you will not edit oftenUpload .html by FTP or File ManagerNoNo
An HTML design you want as a WordPress pageCustom page templatePartlyContent only
A full static site you want to keep editingRebuild or import into WordPressYesYes
An HTML file to offer as a downloadMedia Library (admins)NoNo

If you are unsure, start with the Custom HTML block. It is the safest and keeps everything inside WordPress.

How do you add HTML with the Custom HTML block?

Open a post or page, add a Custom HTML block, paste your code, and use the Preview tab inside the block to check it before you publish.

This works for forms, embed codes, small layouts, tables and tracking snippets. The Custom HTML block documentation explains the block's edit and preview modes.

You can also switch the whole post to the Code editor from the options menu, then paste HTML directly. WordPress converts it into blocks where it can.

Our step-by-step guide on how to add HTML in WordPress covers the block, the Code editor, widgets and theme files in more detail.

Note that some tags, such as script and iframe, are stripped for users without the unfiltered_html permission. On a normal single site, administrators and editors have it.

How do you upload a full HTML file to your server?

Connect to your hosting with FTP, SFTP or the File Manager, then upload the HTML file to your site's root folder or a subfolder, and visit its URL in a browser.

Here is the basic process:

  1. Open your host's File Manager or an FTP client such as FileZilla.
  2. Go to the folder that holds WordPress, usually public_html.
  3. Create a subfolder, for example landing, to keep things tidy.
  4. Upload your file and rename it index.html.
  5. Upload any CSS, images and JavaScript the page needs, keeping the same folder structure.
  6. Visit your domain followed by /landing/ to check it.

If you have not connected by FTP before, our guide on getting FTP access to WordPress explains where to find your login details.

This works because web servers serve real files before WordPress handles the request. WordPress only steps in when no matching file or folder exists.

What are the downsides of uploading HTML files directly?

Uploaded HTML pages sit outside WordPress, so they do not use your theme, menus, plugins, SEO settings or sitemap, and you must edit them by hand on the server.

That is fine for a one-off landing page or a verification file. It becomes a problem if you need to update the page often or want it to match the rest of the site.

Watch for these issues:

  • Name clashes. A folder called blog or shop can hide a WordPress page with the same slug.
  • No SEO plugin control. Titles, meta descriptions and schema must be written into the HTML yourself.
  • Not in your sitemap. Add the URL manually or search engines may find it slowly.
  • Backups. Some backup plugins only include WordPress files, so check that custom folders are included.

Can you upload an HTML file to the Media Library?

Yes, administrators can usually upload .html files to the Media Library, but users without the unfiltered_html permission cannot, because WordPress blocks HTML uploads for them.

WordPress removes the htm and html file types from the allowed list for users who cannot post unfiltered HTML. The get_allowed_mime_types reference shows this check.

On multisite networks, only super admins have that permission, so site admins see an error that the file type is not permitted.

Media Library uploads give the file a URL under wp-content/uploads. That is fine for a downloadable file, but it is not a good home for a real web page.

If you hit a size error instead, see our guide on increasing the max upload size.

How do you turn an HTML page into a WordPress page template?

Copy your HTML into a new PHP file in a child theme, add a template header comment, swap static parts for WordPress functions, then assign the template to a page.

A minimal page template starts like this:

<?php
/*
 * Template Name: My HTML Page
 */
get_header();
?>
<!-- your HTML here -->
<?php get_footer(); ?>

Place the file in a child theme so a theme update does not erase it. Then edit a page and pick My HTML Page from the template setting.

The developer handbook on page template files explains the header comment and naming rules.

Our guide on creating a custom page template walks through the full process, including block theme templates.

Can you move a whole static HTML website into WordPress?

Yes, but there is no one-click import that keeps your design; you either rebuild the pages with blocks and a matching theme, or use an import plugin to pull in the content and then restyle it.

Small sites are usually easiest to rebuild by hand. Copy the text and images into new pages, recreate the layout with blocks or patterns, and set up menus.

Import plugins can bring in many pages at once by reading the HTML files. They save typing, but you will still need to clean up the layout.

Keep your old URLs if you can, or set up 301 redirects from the old .html addresses to the new pages so you do not lose search traffic.

If you are still deciding, our comparison of static sites vs WordPress covers the trade-offs in speed, cost and editing.

Is uploading HTML to WordPress safe?

Uploading your own HTML is safe, but only paste code from sources you trust, because scripts inside HTML run with the same access as the rest of your site.

A malicious script in a Custom HTML block can steal logins or inject spam. Review third-party embed codes before you paste them.

Keep uploaded HTML files valid and simple. The MDN HTML reference is a good reference if you need to clean up messy markup.

Limit who has the unfiltered_html permission. Only trusted administrators and editors should be able to add raw scripts to your pages.

Frequently asked questions

Why does WordPress say the HTML file type is not permitted?

Your account lacks the unfiltered_html permission, so WordPress removes HTML from the allowed upload types. On multisite, only super admins have it. Upload the file by FTP or File Manager instead, or ask a super admin to upload it for you.

Will an uploaded HTML page show my WordPress header and menu?

No. A raw HTML file uploaded to the server is served on its own and does not load your theme. To get your header, footer and menus, paste the content into a page with blocks or convert the HTML into a page template.

Can I upload HTML to WordPress.com?

You can use the Custom HTML block on WordPress.com, though some scripts are limited on lower plans. Uploading files directly to the server needs a plan with SFTP access. Check the current WordPress.com plan details before you rely on it.

Does uploading HTML files hurt SEO?

Not by itself. Search engines can index plain HTML pages normally. The downside is that your SEO plugin cannot manage them, so you must write titles and descriptions into the file and add the URL to your sitemap or link to it.

Can I put a Google verification HTML file on my WordPress site?

Yes. Upload the verification file to your site's root folder with FTP or File Manager, then confirm it loads at your domain followed by the file name. Most SEO plugins also offer a meta tag method that avoids file uploads.

Sources

  1. Custom HTML block WordPress.org
  2. get_allowed_mime_types() WordPress Developer Resources
  3. Page Template Files WordPress Developer Resources
  4. FileZilla FileZilla Project
  5. HTML: HyperText Markup Language MDN Web Docs

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.