Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 24, 2020 04:51 pm

How to Upload an HTML File to WordPress


In this article, we’ll discuss a couple of different ways that you can upload an HTML file to your WordPress website.


Why Do You Need to Upload an HTML File to WordPress?


When you’re working with a WordPress website, you can use anything from static posts, pages to fancy dynamic features like image galleries, magazines, and eCommerce. You to implement many of these advanced features by just installing and configuring free plugins from the WordPress marketplace.


On the other hand, when it comes to layout and theming of your website, WordPress allows you to choose from thousands of ready-made professional themes available in the market. When you combine these themes with page builder plugins, you can completely customize your front-end the way you want to. And if that's not sufficient, you can customize a theme or build your own theme to give a completely different look to your website.


Having said that, sometimes you would want to upload a specific HTML file which you’ve got from your old site and you just don’t want to touch the rest of your WordPress installation. Specifically, if you might have an HTML file which displays a completely different layout than your existing website, and you want to display it for specific campaigns. Or you might want to verify your website with Google by uploading an HTML file to the document root of your website.


Whatever the reason, we’ll go through a couple of ways to upload an HTML file to your WordPress website in this post.


How to Upload an HTML File?


Let’s quickly summarize the different ways you could use to upload an HTML file:



  • use the FTP client software

  • use cPanel

  • use the back-end editor


FTP Client Software


This is one of the easiest ways to upload files from your computer to the WordPress website. If you’ve got FTP access to your website, you could use the FTP client software to connect to your website and upload necessary files. Thus, keep your FTP credentials handy if you want to use this option. You'll need to have a host, username, password and port.


There are different FTP clients available, and you need to choose one for your OS version. If you’re using *nix-based systems—Linux and Unix— you could use popular options like lftp, gFTP or FileZilla. On the other hand, WinSCP is one of the most popular options for Windows users. Apart from this, you could also use the FireFTP extension which is installed as an add-on in the Mozilla Firefox browser.


Once you’ve installed your favorite FTP client, go ahead and open it. Enter the necessary information as shown in the following screenshot and connect. I’ve used the gFTP client.


gftp UI

Once you connect to the server, you should be able to see the list of files available in your WordPress installation. On the left hand side, gFTP lists files on your local computer and it displays remote site files on the right hand side.


Now, it’s time to upload the desired file from your local computer to WordPress. On the left hand side, navigate to the directory where the HTML file resides, select the file, and finally drag and drop it on the right hand side. Alternatively, you could also double-click that file to upload it.


Once you’ve uploaded the file, make sure that the file is uploaded properly by visiting the http://your-wordpress-website/myhtmlfile.html URL in your browser.


So that’s how you can upload files from your computer to WordPress by using the FTP client software. In the next section, we’ll discuss how you can use cPanel to achieve the same thing.


CPanel


In this section, we’ll see how you could upload an HTML file to your WordPress with the help of cPanel. Of course, you need to have cPanel access on your host to use this option! You can learn more about free WordPress hosting options here at Envato Tuts+.



Using cPanel is pretty similar to using FTP. You need to navigate to the WordPress installation directory and upload any desired files.


Go ahead and login to your cPanel. On your dashboard, you should be able to see the following different options.


Cpanel Dashboard

Next, click on the File Manager link on your dashboard, and that should take you to the screen which lists different files on your server. Navigate to the desired WordPress installation directory where you want to upload the HTML file. It should display files as shown in the following screenshot.


File Manager UI

On the top of the screen, it displays different buttons that allow you to perform different file operations. Among them, the Upload button allows you to upload files from your computer and that’s what we’re going to use in our case.


Go ahead and click on the Upload button, and it would display a popup screen as shown in the following screenshot.


Upload File Popup

Basically, it’s asking you to choose the file which you want to upload. Click on the Select File button and choose the desired file from your computer. And then cPanel should upload the selected file to the desired directory. Once the file is uploaded successfully, you should be able to see the uploaded file in the list of files under your WordPress installation directory.


If there’s any error uploading your file, it will display a helpful message which allows you to take necessary actions to fix the cause of the error. Mostly, errors are related to the directory permissions or the size of your file exceeding the upload limit.


In this way, cPanel allows you to upload files from your computer to your WordPress website. In the next and last section, we’ll see how you can upload a file from the WordPress dashboard.


WordPress Dashboard


In this section, we’ll discuss how you can upload HTML files with the help of the built-in media manager available on your WordPress dashboard.


Before you go ahead and exercise this option, however, you'll need to make changes in your WordPress configuration file. By default, WordPress allows you to upload files that match with specific extensions for security purposes. Mostly, you could upload files that belong to valid media files like .jpg, .gif, .png, .pdf etc. On the other hand, you can’t upload files that have extensions like .html, .js, .php and so on.


So if you want to upload a file which is not a valid media file and doesn’t belong to one of the valid media extensions in WordPress, you need to make a special change in your WordPress configuration file. Note that it must be a temporary change and you must undo it once you finish uploading files. I would recommend you to use this option only if you know what you’re doing.


Go ahead and open the wp-config.php file with your favorite text editor. The wp-config.php file resides in the root of your WordPress installation. Add the following snippet at the end of your file.



Once you’ve done it, upload the updated wp-config.php file to your WordPress site. With these changes in place, you would be able to upload .html files from your computer. 


Next, head over to your WordPress dashboard and navigate to Media > Add New. It would display the following screen.


Add New File - Media Manager

Click on the Select Files button which allows you to choose files from your computer that you want to upload. Select the desired files and they'll be uploaded right away as shown in the following screenshot.


Uploaded File Preview

Now, navigate to the Media > Library section, and it should display the list of files. Click on the file which you’ve just uploaded to see file details. You would see the File URL field which contains the link of this file as shown in the following screenshot.


Uploaded File URL

You could copy it and paste it in your browser to see if it works. This is the link which you would need to access this file in your front-end.


So that’s how you can upload files with the help of the Media manager from your WordPress dashboard. Don’t forget to undo your changes in the wp-config.php file as it would be a dangerous security problem to keep it open.


Conclusion


Today, we discussed different options that you could use to upload an HTML file to your WordPress website. Feel free to post if you have any queries or doubts using the feed below.


Install a Premium WordPress Widget or Plugin Now! 


There are thousands of high-quality WordPress plugins on CodeCanyon that can help enhance your business's website. Have a look through this large collection of plugins, and you'll find helpful plugins in all different types of categories, from marketing to eCommerce to social media.




Find the perfect WordPress plugin to help your business succeed and motivate your customers. You can find even more plugin ideas and inspiration in our new free course on finding the best WordPress plugins for your site.




This post has been updated with contributions from Nathan Umoh. Nathan is a staff writer for Envato Tuts+.



Original Link: https://webdesign.tutsplus.com/tutorials/how-to-upload-an-html-file-to-wordpress--cms-36393

Share this article:    Share on Facebook
View Full Article

TutsPlus - Code

Tuts+ is a site aimed at web developers and designers offering tutorials and articles on technologies, skills and techniques to improve how you design and build websites.

More About this Source Visit TutsPlus - Code