BACK TO TOP

How to Add a Custom HTML Page to Your WordPress Website

How to Add a Custom HTML Page to Your WordPress Website

One of the major advantages of WordPress is its remarkable user-friendliness. It lets users of all levels create websites and web pages with ease. On top of that, it provides options for content display in the form of various custom post types, primarily pages and posts. And depending on the WordPress theme you select you will probably have some page design templates, especially with premium themes. There are also several page builders you can install and use to develop your site and add content to your pages in a way that fits your design idea.

So with all of these, why would you need to add a custom HTML page to your WordPress website? There are several reasons—most to do with providing you with a greater range of customization options. In this article, we’re going to take a look at the whys and hows of adding custom HTML pages to WordPress.

Why You Should Add Custom HTML Pages to Your WordPress Website

Despite the many options already available for creating and adding WordPress content, there are several specific reasons why adding an HTML page to your web site is a good idea. It might be because you already have an HTML template you like and that you’ve used before. Alternatively, you find your chosen theme limiting so you’re not able to create the kind of page you want.

Say you used a great HTML template to develop a prior website or that you have a favorite HTML template that you regularly use and now want to include it on a new website. You can easily add that template to your current WordPress installation. This way, you can avoid working from scratch, save time, and make sure your page looks exactly the way you want it to on the new website.

Using a custom HTML page is also a great solution when your chosen theme can’t make or doesn’t support a specific page layout you envisioned. So you can still achieve your intended design and customize the page to your needs by adding a custom HTML page.

How to Upload an HTML Page to a WordPress Website

To be able to follow along with this next section, you should have an HTML template that you plan to add to your WordPress site prepared. To help with upload later, we suggest you create a folder on our computer that will contain your HTML template, an index.html file, and whatever dependencies you have. For our demonstration, we have created a custom folder on the computer. In it, we saved the index.html file with our custom HTML elements and a style.css file which will affect the appearance of those HTML elements. We did this so that the folder and files are completely separate and independent from the WordPress theme used on our installation.

So if you haven’t prepared your custom HTML page and all the necessary files first, now is the time to do it. When you’re done, pack all the files in the folder into a .zip archive. Then you can proceed to access the server where your WordPress installation is located in order to upload them. You can connect to the server via FTP or access it using your hosting control panel. We will be using our hosting account’s cPanel and its File Manager option to guide you through the upload steps.

After logging into your hosting account, select the File Manager in the Files section.

File Manager

Depending on your provider, your hosting control panel may look different, but it will have a similar option. You just need to locate it and use it to access the public or root folder of your WordPress site on the server.

After that, create a new folder within the root folder. How you name it is entirely up to you, but clarity is always a good idea, so we are using custom-html-page for our example. New folders are created by clicking on the Folder button in the upper left corner and giving them a name in the resulting popup.

Folder button

Open the folder you just created and in it, using the upload button from the options tab above, upload the .zip archive with your custom HTML page from your computer.

Zip archive

When the file is done uploading, you need to unzip it. There are two ways to do that—via the Extract button in the options tab or by selecting the file, right-clicking, and choosing Extract from the dropdown.

Extract from the dropdown

You will then be asked to select the exact location where you want your files to be extracted. We suggest leaving the same location you’re atpublic_html/your-folder-name.

Select the exact location

After that, you can delete the .zip file—you won’t need it anymore, and keeping it will needlessly weigh the server down. So your folder should now contain only the files you need for your HTML page. In our case, we have the index.html file along with the images and style folders.

Index html

Now you can check on your page by opening it in a web browser. The URL needs to contain the name of the folder you created, so the link for your custom HTML page would look something like www.yourwebsite.com/your-folder-name. Since we named our folder custom-html-page, the link required to open the new custom page will be:

The URL

If you try to access your new page and get a 404 error, don’t worry. This is a common error in WordPress and, generally, 404 errors are easy to resolve. If your server doesn’t support redirection, the index.php will not be redirected when you enter the URL for your custom HTML page, and a 404 error will occur.

404 errors

You can troubleshoot this error by locating the .htaccess file and editing it. It should be in your WordPress installation’s root folder. So, when you’ve found it, open it for editing and add the following code:

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

After entering the code, save the changes you made to the .htaccess file. Then try to reopen your custom HTML page in the browser. Don’t forget to clear the cache first.

This code will redirect your index.php file and load it in the browser. If you’ve used a case-sensitive name for the folder or any of the files it will also work to redirect them and show you their contents.

Qode WordPress Themes: Top Picks
Bridge WordPress Theme Banner
Bridge

Creative Multi-Purpose WordPress Theme

Stockholm WordPress Theme
Stockholm

A Genuinely Multi-Concept Theme

Startit WordPress Theme
Startit

Fresh Startup Business Theme

Biagiott banneri
Biagiotti

Beauty and Cosmetics Shop

Final Thoughts

WordPress is by far the most popular content management system (CMS) in the world because it gives its users all the flexibility they need to create unique websites. The option to add custom HTML pages or files is just another point in its favor. It gives WordPress users more freedom and the ability to customize sites to suit diverse needs.

Knowing all the different ways you can employ to get the appearance you want for your website is extremely useful. And we hope this article will help you when it comes to creating a unique and stunning design for your website.

Post your comment

Comments0