Our Blog

How to Upload an HTML file to WordPress (3 Effective Methods)

There are thousands of reasons that WordPress is such a highly reputed platform for website creation and management. WordPress also comes with the ability to use built-in content types and content structures so that small and medium scale businesses need to invest less time in deciding the nitty-gritty of their website requirements. Due to the availability of hundreds of plugins, themes, features, widgets, the need for converting HTML code to WordPress rarely arises.

But tasks such as regaining your HTML website’s design on your WordPress website and formulating custom themes, adding desired page layouts can all be effectively done using HTML code. Just ensure to upload your HTML file in the Google format to ensure that your innovations are eligible to arise in SERP’s.

There are 3 effective methods that can be adopted to transfer an HTML file to your WordPress website. We have curated them in order of difficulty from easiest to hardest –

Method 1 – Via the WordPress dashboard

This method can be executed by simply logging into your WordPress admin panel, accessing the dashboard and accessing the posts tab. If you have enabled access to the Gutenberg Editor, then click on the file button and upload your desired HTML file. But if you have disabled your editor then click on the add media button while you are editing/making a new blog post. Uploading the link here also directly uploads to your media files repository.

If you may need to use the HTML file time and again, then it would be smarter to directly upload it to your media library. As you can easily add the file as and when needed.

Method 2 – Via an FTP client

Now, sometimes there are cases where the HTML file size may be large and also consist of several different sections that need to be amalgamated to produce the final outcome. For files as such, you must use FTP clients such as CyberDuck, WinSCP or FileZilla. Create a backup in such cases to make sure that the file, if unsafe, does not negatively impact your website. If you want to test some ideas before making your website live, then doing it via FTP is an ideal option.

Access your web hosting account and gather your FTP login credentials (username, password, and porting number). Now you can access the FTP client via FileZilla and insert your login credentials along with your website name. Double-check the information and click on Quickconnect to access the repository of your website’s data.

First, on the right half of your window, navigate to the wp-content folder or the wp-config.php file that is available in the root folder of all your website’s data. Then from the left half of your web window, you can choose the desired HTML file and upload it to your repository.

To verify whether the outcome of your actions is visible on your webpage simply type in www.websitename.com/html-file. This will give you access to the brand-new webpage that your HTML file has created for you. Whenever converting any site to WordPress it would be wise to add extra HTML code that you have future plans for.

Method 3 – Using a cPanel

For this method, you need to access the cPanel on your web hosting account. You have to open the file manager and execute either of the 2 options. The first option is to make a new folder in your site’s root directoryand upload your HTML file directly in the new folder. The second option is to directly upload the file into your root folder and ensure to follow these steps –

  • Get to the root folder of your file manager and then create a new folder. The root folder would consist of files like the wp-content and wp—config.php file. Keep a relevant name for this new folder for you to easily identify.
  • Now you need to double-click on this new folder and select the upload option. Upload the HTML file. You will notice that the HTML file is now zipped and in the folder.
  • Right-click on this HTML file and select the Extract option. A new window will pop-up and you can click on extract files. Now that your HTML file has been unzipped, all its contents can be seen in the on-screen template.
  • To confirm that the process was a success you need to type in the name of your website, followed by a slash and the name of your HTML file. The format is websitename.com/html-file. You will see the additions/changes on your website if the code was perfectly executed.

Occasionally, you may receive a 404 error. But there is no reason to take tension as these issues can be resolved with minimal effort and time. The main reason this error occurs while converting from HTML to WordPress is because the server provider does not support redirection and the index.php file does not open despite typing in the correct URL. The solution to this is accessing the .htaccess file in your file manager and adding the following piece of code –

RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L]

This ensures that your index.php file is redirected whenever someone puts your website URL into their browser. HTML code is a great way to modify your website and inculcate additional features, plugins, themes and customized pages for a richer and more relevant user experience.

Leave a Reply

Your email address will not be published. Required fields are marked *