Uploading an HTML file to WordPress depends on what you need the file to do. A complete .html document that should open as a separate webpage is different from HTML code that belongs inside an existing WordPress page. For a standalone HTML file, upload it to the web server with your hosting File Manager or SFTP/FTPS, then open its direct URL. For HTML code inside a WordPress page or post, use the Custom HTML block.
1. Upload an HTML File Using Hosting File Manager
This is the simplest method for a finished file such as landing-page.html, offer.html, or index.html.
- Log in to your hosting control panel.
- Open File Manager.
- Find the folder containing your WordPress installation. On many hosts this is
public_html, but the exact location varies. - Open the public folder where you want the file.
- Click Upload and select the
.htmlfile. - Confirm the filename and complete the upload.
- Open the file URL in your browser.
For example, landing-page.html uploaded to the site’s public directory may be available at:
https://example.com/landing-page.html
The exact URL depends on its server location. WordPress does not automatically turn an uploaded HTML file into a normal WordPress Page or WordPress permalink. It remains a separate static file.
If the page uses CSS, JavaScript, images, fonts, or other assets, upload those files too and keep the same folder structure and relative paths. Uploading only the HTML file often causes missing styles, images, or scripts.
2. Upload the HTML File With SFTP or FTPS
SFTP or FTPS is useful when your hosting provider gives you server credentials. WordPress recommends encrypted SFTP or FTPS instead of plain FTP.
Connect your file-transfer client with the host details supplied by your provider. Locate the WordPress directory and upload the HTML file and its required asset folders.
Do not place custom HTML pages inside wp-admin or wp-includes, because those directories contain WordPress core files. Use the site’s public directory or a dedicated subfolder instead.
3. Upload an HTML File Through the WordPress Media Library
WordPress core currently lists text/html among its allowed MIME types, so an HTML file can be uploaded through the media system when the site’s configuration and the user’s permissions allow it. WordPress also checks file types during the upload process.
In the dashboard, go to Media → Add New and select the HTML file. After uploading, open its details and copy the file URL. WordPress generates URLs for uploaded media, with the exact path controlled by the site’s upload settings.
Use this method when you mainly need to store the HTML file and provide a direct link. For a multi-file project, direct server upload is easier because you can preserve the folder structure.
4. Add HTML Code Inside a WordPress Page
If you only want HTML markup to appear inside an existing post or page, you do not need to upload an .html file.
Open the WordPress editor, click the + Block Inserter, add a Custom HTML block, and paste the code. WordPress provides this block for raw HTML inside page and post content.
Use it for HTML sections, tables, buttons, or other markup that belongs inside the WordPress page. A full document containing <html>, <head>, and <body> should be treated as a separate webpage, not ordinary page content.
WordPress can also sanitize disallowed HTML depending on user permissions. Users without the unfiltered_html capability can have elements such as <script> or <iframe> removed from Custom HTML content.
Common HTML Upload Problems
If the uploaded page shows a 404 error, check the exact filename, folder, and URL. The URL must point to the file’s real server location.
If the page opens but looks unstyled, check the paths to CSS, JavaScript, images, and fonts. Relative paths must match the uploaded folder structure. Replace local references such as file:/// or computer-specific paths with web-accessible URLs.
If WordPress rejects the upload, check the site’s allowed file types, your user permissions, and hosting restrictions. WordPress validates uploaded file types and can reject a file when the type is not allowed or the user lacks the required capability.
Which Method Should You Use?
For a standalone HTML webpage, use the hosting File Manager or SFTP/FTPS. For an HTML file you simply need to host and link to, the Media Library can work when HTML uploads are permitted. For HTML code that should appear inside a WordPress page, use the Custom HTML block.
The difference is straightforward: a server upload creates a separate static file, while a Custom HTML block adds markup to a WordPress-generated page. Choosing the method that matches your goal avoids broken asset paths, upload errors, and unnecessary WordPress configuration changes.
More Guide On HTML
How To Add Html To Lioden Profile
How To Add Html Signature To Apple Mail
How To Add Textures In Html Games
How Do You Indent In Html
How Long Does It Take To Learn Html
How To Convert Html To Excel
How To Embed A Google Form In Html
How To Get Html Code From A Website
How To Hide Text In Html
What Are Tags In Websites
What Does Hr Stand For In Html
