“Upload an HTML file to WordPress” can mean two different jobs. If you want the markup to appear as part of a post or page, use the block editor’s Custom HTML block. If you want visitors to download an existing .html document, upload it through Media → Add New and link it with a File block. Uploading an HTML document to the Media Library does not, by itself, turn that document into a normal WordPress page.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Choose the workflow that matches the result you need
Decide what a visitor should see after clicking or loading the content before you touch the dashboard. The two workflows use different WordPress features and have different permission and security implications.
As an Amazon Associate I earn from qualifying purchases.
| Goal | Use | What visitors get | Important constraint |
|---|---|---|---|
| Show HTML as part of a post or page | Block editor → Custom HTML | Rendered markup inside the WordPress page layout | WordPress may sanitize tags, styles or scripts when the author lacks unfiltered_html. |
Keep a complete .html document for visitors to download |
Media → Add New, then a File block | A link that downloads or opens the uploaded file, depending on the browser | The file remains an attachment; it is not automatically parsed as a WordPress page. |
| Link to a file already hosted elsewhere | An ordinary link or an embed supported by that service | The external resource, without a new Media Library upload | You must control or trust the external URL and its access permissions. |
The choice also affects risk. A rendered block can place HTML in your site’s page context, while accepting HTML files as media expands the kinds of content your server stores and serves. Use the least powerful option that meets your goal.
Render HTML inside a WordPress post or page
This is the correct route when you have a fragment such as a table, callout, form markup or custom layout and want it displayed within the site’s existing header, footer and theme styles. You are inserting code into the editor, not uploading a standalone document.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Insert a Custom HTML block
- Sign in to the WordPress dashboard and open the post or page in the block editor.
- Select the Block Inserter (+).
- Search for Custom HTML and select the block. You can also add a new paragraph, type
/html, and press Enter. - Paste or type your markup in the block’s HTML editor.
- Use the block’s preview to check the rendered result. Previewing helps catch unclosed tags, incorrect attributes and layout problems before publication.
- Select Update (or Publish for a new page) to save the block.
The Custom HTML block is intended for code that belongs in the page content. Keep the snippet self-contained: use semantic elements, close every tag and avoid assumptions about scripts or styles loaded by another site.
WordPress 7.0 panels and capability checks
Starting with WordPress 7.0, the Custom HTML block has separate HTML, CSS and JavaScript panels. The extra CSS and JavaScript panels are available only to users who have the unfiltered_html capability.
When an author does not have that capability, WordPress sanitizes the block with wp_kses() when the post is saved or updated. Disallowed elements can therefore disappear even if they were visible while editing. Tags such as <script> and <iframe> are common examples of markup that may be removed.
- If your code is harmless presentation markup, redesign it with allowed HTML and the site’s normal block or theme controls.
- If a trusted administrator requires scripts or an iframe, ask an administrator to review the code and the author’s capability rather than granting broad access casually.
- After saving, reopen the post and inspect the block. A preview before saving is not proof that the final stored markup will be unchanged.
Keep the snippet compatible with the page
A Custom HTML block sits inside the theme’s document, so a complete document wrapper is usually unnecessary. Do not paste a second <html>, <head> or <body> structure into ordinary page content. Add only the fragment needed for the visible section. If the design needs CSS, keep selectors narrow so they do not unexpectedly restyle the rest of the page.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Scripts have additional concerns: they may be stripped, blocked by a security policy, depend on libraries that are not loaded, or execute differently for logged-in and logged-out visitors. If a script is essential, document its dependency and have the site administrator decide where it should be loaded.
Upload an existing .html document as a downloadable file
Use this workflow for a finished document that visitors should receive as a file: a game guide, a static report, an exported page or an offline reference. The Media Library stores the file and WordPress can expose its attachment URL, but the upload does not convert the document into a page managed by the block editor.
Upload through Media → Add New
- In the dashboard, open Media → Add New. You can also use the upload control in the Media Library.
- Drag the HTML file into the upload area, or select Select Files and choose it from your computer.
- If the multi-file uploader fails, use the Browser Uploader fallback.
- Wait for WordPress to finish processing the upload. If it reports an extension, size or permission error, use the troubleshooting sections below before retrying.
- Open the new attachment’s details and copy the read-only File URL. This is the address that can be placed in a link.
The Media Library’s File URL is an address to the stored attachment. It is not an editor view of the document and it does not inherit the surrounding page’s navigation or theme layout.
Add the download link with a File block
- Open the page or post where the link should appear.
- Insert a File block.
- Select the uploaded HTML document from the Media Library, or choose the option to upload it from the block.
- If the file is already uploaded, paste its copied File URL into a normal link instead.
- Enter descriptive link text, such as “Download the HTML game guide,” rather than relying on an unexplained filename.
- Save or publish the page, then test the link in a private browser window.
The File block is designed to provide a downloadable-file link. Depending on the visitor’s browser and settings, clicking an HTML file may open it in a tab instead of forcing a download. If a download prompt is essential, that behavior must be controlled by the server’s response headers or another delivery method; WordPress’s link alone does not guarantee it.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
When an external link is the better option
If the document is already hosted on a service you control, an external link can avoid a second copy in the Media Library. Confirm that the destination is publicly reachable (or intentionally restricted), uses the expected file, and will remain available. An external link is not a workaround for a destination that requires credentials the reader does not have.
Fix “This file type is not allowed” for .html
WordPress can reject .html uploads for security reasons. A WordPress support response notes that the core upload check may still block the extension even when a plugin appears to permit it. Treat this as an administrator decision, not as a reason to disable upload protections for every user.
Free tools Windows power users keep installed
One-click scans. No signup required.
Use an administrator-reviewed solution
- Ask a site administrator to confirm whether the file really needs to be stored in the Media Library. If the objective is rendered content, move the markup into a Custom HTML block instead.
- If the extension must be allowed, have the administrator implement a controlled MIME-type change or use a reputable file-type management plugin, then test uploads with a non-privileged account.
- Limit the permission to trusted users and review the resulting files. Allowing HTML expands the possibility of serving active content from the site’s own domain.
- Do not rename the file merely to hide its extension. A renamed document can break relative links, confuse users and still be rejected or mishandled by the server.
After any MIME-type change, verify both upload and delivery: confirm that the file is stored at the intended URL, that an unauthenticated visitor receives the intended response, and that unrelated dangerous file types remain blocked.
Fix upload-size errors
The Media → Add New screen displays the maximum upload size configured by the hosting provider. A “file is too large” message therefore points to the host or server configuration rather than to the File block.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- Read the maximum-size notice on the Add New screen and compare it with the HTML file’s actual size.
- Remove unnecessary embedded assets from the document. A small HTML file can become large when images, fonts or data are embedded as base64 content.
- For a legitimate large document, ask the hosting administrator whether the server limit can be raised safely. The change may involve PHP, the web server or a managed hosting control panel.
- If the limit cannot be changed, host the file on an appropriate external service and link to it, or split the content into smaller documents.
Do not assume that compressing a file into a ZIP is equivalent to uploading the HTML itself. A ZIP gives readers an archive, not a directly viewable HTML document, and it changes the experience you are offering.
Fix permission-denied and upload-directory errors
WordPress documentation states that correct permissions for the wp-content directory may be required for media uploads. Errors mentioning a missing upload directory, inability to write a file or permission denial generally require hosting or filesystem changes.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →- Record the exact error and the time it occurred. Avoid repeatedly changing permissions without a backup or an administrator’s plan.
- Ask the hosting administrator to verify that the web server process can write to the configured uploads directory and that the directory belongs to the expected account.
- Check whether disk space, inode limits or a read-only filesystem is preventing writes.
- Retry with a small, ordinary media file. If that also fails, the issue is broader than the HTML extension.
- Once the directory is corrected, retry the HTML upload and confirm that the attachment URL resolves.
Do not make the entire site filesystem world-writable to solve one upload error. Overly broad permissions create a larger security problem than the original failure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Fix scripts, iframes or styles that disappear
First identify whether the code was inserted through a Custom HTML block or uploaded as a file. A standalone uploaded document is not being sanitized as post content in the same way as an editor block; a block can be filtered when it is saved.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Reopen the post after saving and compare the stored block with the original markup.
- Check whether the author has
unfiltered_html. Without it, WordPress can remove disallowed tags throughwp_kses(). - Assume that
<script>and<iframe>may be removed for users without the capability. Do not repeatedly paste the same code and expect it to persist. - Ask an administrator to review a safe implementation, such as a supported embed block, a sanctioned plugin integration or a server-managed script enqueue.
- Test the page while logged out. Editor previews can differ from what ordinary visitors receive.
For CSS that vanishes, check whether it was entered in the WordPress 7.0 CSS panel, an inline style attribute or a theme stylesheet. Each location is governed by different permissions and sanitization rules.
Security and maintenance checks before publishing
HTML is active content, not just a passive text format. A file can contain scripts, frames, redirects, forms or links to resources outside your control. Apply a review process appropriate to who can upload and who will open the file.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall- Accept HTML uploads only from trusted authors and only when a downloadable document is genuinely required.
- Inspect the source for scripts, hidden frames, unexpected forms and external requests.
- Use descriptive filenames and link text so readers know what they are opening.
- Test the attachment URL in a private window and on a mobile browser.
- Check relative links and images. A document moved into a Media Library subdirectory may no longer resolve paths that worked on a local computer.
- Keep a copy of the original file and record who approved the upload.
- Review old attachments periodically and remove documents that should no longer be public.
If the content is intended to be a normal article, a WordPress page built from blocks is usually easier to update, search and protect than a separate HTML document. Reserve the attachment workflow for cases where preserving the standalone file is part of the requirement.
A practical decision checklist
- Define the output: rendered page content means Custom HTML; a file readers receive means Media Library plus File block.
- Check permissions: confirm whether the author has
unfiltered_htmlif CSS, JavaScript, an iframe or other filtered markup is necessary. - Check limits: read the maximum upload size shown on Media → Add New.
- Check storage: verify that
wp-contentand its uploads directory are writable by the WordPress process. - Review security: approve the markup and decide whether serving active HTML from your domain is acceptable.
- Test the visitor experience: save the page, open the public URL while logged out and test the link or rendered block.
Common mistakes to avoid
- Uploading when you meant to render: the visitor receives a file link rather than seeing the design inside your page.
- Pasting a full document into a block: nested document wrappers can produce invalid or unpredictable page markup.
- Assuming preview equals saved output: sanitization can occur during Update, especially without
unfiltered_html. - Changing MIME settings without review: a broad allowance can expose the site to unwanted active content.
- Ignoring the hosting limit: repeatedly retrying a file that exceeds the displayed maximum will not solve a server-side restriction.
- Making permissions excessively broad: writable-everywhere fixes can enable unauthorized changes.
- Using vague link text: “click here” gives no indication that the destination is an HTML document.
What the two workflows mean for a game-focused site
For a walkthrough, strategy article or news post, place the necessary markup in a Custom HTML block so it remains part of the page’s normal navigation and responsive layout. For a preserved fan-made guide, tournament ruleset or offline reference that readers may save, upload the .html document and present it as a clearly labeled file link. If you need both experiences, maintain a readable WordPress page and offer the standalone HTML as a separate download; do not assume one upload supplies both.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




