At the beginning of the web, all the websites were developed with static HTML code. Today, the web has become a different place, and websites are getting more complex while offering more enjoyable and richer experiences. A major reason behind this is the introduction of open-source development platforms such as WordPress. This platform is now utilized by more than 44 percent of all live websites, while in 2011, it was around 13 percent.
The reason behind the growing popularity of WP compared to static sites such as HTML is its easy-to-maintain nature. Converting an HTML design into a WordPress theme is a creative task that needs a lot of expertise. Today in this guide, we have tried to explain how to get it done easily using multiple methods.
Let’s have a look.
Before you can proceed with the HTML to WordPress Conversion. There are some important things that you need to know to ensure a smooth conversion process.
Before beginning the HTML to WordPress theme conversion process, ensure that you have a backup of the HTML site. Take a backup of major components such as images, JavaScript, CSS, HTML files, and other important assets.
For creating a new WordPress website design, you will need an active hosting plan. Understand your hosting requirements and choose one properly. Don’t forget to check the features, hosting type, scalability, and customer support quality of the hosting service.
Use Code Editor to convert HTML files into WP themes. While the options are more, some easy-to-use and popular code editors are Atom, Sublime Text, Notepad++, Visual Studio Code, and Adobe Dreamweaver. Before selection, ensure that your code editor supports plugins, customization, and syntax highlighting.
Analyze the money and time you can invest in this process. Some specialized conversion tools can be used for a faster HTML to WP conversion. It may be expensive, but you will save time and lower chances of errors. However, to complete the project quickly with no loopholes, hiring a professional web developer would be an ideal option.
There are different methods to proceed with HTML to WP conversion. However, the right method for you will rely on different factors like your coding skills, budget, personal preferences, and available time.
Let’s get started with some effective HTML to WordPress conversion methods you can try.
The first method of converting an HTML to a WordPress theme is the manual approach. Before starting, make sure you can access the new and original website’s files. In this process, you need to utilize an SFTP or Secure File Transfer Protocol application. Follow the below-mentioned steps to proceed.
Step 1: Creating A Theme Folder
It is mandatory to create a separate folder to keep files related to the new theme before starting the project. Label the folder with the theme’s name. Now, you will have to create five different files inside the new folder, such as:
● Style.css
● Header.php
● Sidebar.php
● Index.php
● Footer.php
Prefer keeping these files open using a code editor as you will edit these files throughout the process. You can even start by creating a .txt version of these files. Once you are done editing the files, you can change the extension to .css or .php.
Step 2: Copy the Existing CSS to the Style Sheet
If you are migrating from the old HTML site to WP, you need to copy the old site’s CSS code and paste that into the new style.css file. Be careful while doing this, as CSS plays an important role in the overall look of your site.
Once done, you need to fill out different sections of the style sheet header. These are:
● Theme URL
● Theme Name
● Author URL
● Author Name
● Version
● Description
● Tags or Licenses
After customizing the header, paste the CSS code copied from the HTML website into your file. Save it.
Step 3: Separate Your Existing HTML
In general, to access database information, WP utilizes PHP. That’s why it is important to separate the existing HTML code into different PHP files. This will allow WP CMS to string those files together properly.
It may appear like a complex process, but here, you just need to copy sections of the HTML file and paste them into various PHP files.
First, you need to open the Index.htm file. Then, copy the code into three important areas, these are:
Header.php- Paste “<?php wp_head () ;>” just before “</head>”.
Footer.php- Before the </body>, you need to add a call function for “<?php wp_footer () ;>”.
Sidebar.php- Paste all the code starting from the section called “<aside>”.
After this, you can close the index.html file but keep the index.php and header.php open.
More to Do with HTML: Converting PSD To HTML: A Complete Tutorial
Step 4: Configuring the Index.php File
Even though you have customized the header.php file, there are a few more things you need to do to make the website work properly. You need to configure the call in your stylesheet to match the standard format of WP PHP.
To begin with this, search for the text in the <head> section. It will appear like this:
“<link rel=” stylesheet” href=” style.css”>”
Then, you need to replace that text with the following text:
“<link rel=” stylesheet” href=” <?php echo get_template_directory_uri () ;>/style.css” type=”text/css” media=” all” />”
Once done, save the header.php and close it.
Now, open the index.php and enter the following:
<?php get_header ();?>
<?php get_sidebar (); ?>
<?php get_footer(); ?>
In the space between the 1st and 2nd code lines, you need to paste the loop code. The code will begin from here:
“<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>”
And will end here:
“<p><?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>”.
After this, you can save the index.php file and close it. Well, the basic theme is now ready to be added to the WP site.
Step 5: Uploading the New WP Theme
Take a screenshot of the new theme. Ensure that it is in 880x660 pixels. Save it in .png format. After that, upload the screenshot into the theme folder. Now, you are ready to upload the new WP theme. For this, you can use two different techniques.
The first technique is by utilizing FTP, using it you can directly drag the theme files into the theme’s directory located inside the wp-content section. For this, you don’t have to compress the files. Just use any available FTP client such as FileZilla, WinSCP, or WS_FTP Professional for this task.
In the second method, you need to convert the theme folder into a zip file. After that, follow these steps:
● Click on the Appearance option and choose the Themes option.
● Tap on the Add New box and then tap on the Upload Theme option.
● Click on the Choose File option and select the converted file.
● Once done, click on the Install Now option to begin the installation process.
● After the installation, click on the Activate option to activate your new theme.
You can now see the new theme under the Active Theme section. From there, you can customize the theme if you want.
As compared to manual conversion, some people may find this method a little easier. The child theme can have the same base style and functionality as a parent theme. Even when you update the parent theme, the child theme allows you to preserve the customization or tweaks you have made.
The best thing is that you can choose a ready-made WP theme to get started with this process instead of customizing your existing website. Below are the steps that you need to follow under this method.
Step 1: Choosing A Perfect Theme
Go to the WP theme directory and choose a theme that you like. Once you choose one, install the theme, but don’t activate it.
Step 2: Creating A Folder for The Child Theme
Visit the Themes Directory and create a new folder to access the files using an FTP application. Rename the folder with the same name as the parent theme and add “-Child” to the end of the name without any space. For instance, if you are creating a theme for Astra, you need to create a folder with the name “Astra-child.”
This way, the child theme will pull the styles and functions from the parent theme after configuring the required theme files.
Step 3: Setting Up a Style Sheet
Create a Style.css file. Every style.css file should contain the required header fields and a File Header to make the child-parent themes work properly. Additional styling information can also be taken from the original HTML files.
Step 4: Creating A Functions.php File
As you have two themes to work with, it is necessary to tell WP that the child theme depends on the CSS files of the parent theme. For this, it is crucial to create a Functions.php file or wp_enqueue_style () PHP. You need to place the functions.php file in the folder of the child theme.
The below-mentioned code can be added to the Functions.php file.
“ <?php
function child_styles() {
wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() . '/style.css', []);
}
add_action( 'wp_enqueue_scripts', 'child_styles', 99 );”
This will enqueue or import the Style.css file of the child theme.
Step 5: Activating Your Child Theme
Now that you are done with creating the child theme, it’s time to activate it. For that, visit the Appearance section in WordPress and then go to the Theme section. Locate the child theme and click on the Activate option to use it as your site’s theme.
Now, you can copy the content of your HTML site into the WordPress website.
If you are looking for the quickest method to convert an HTML website to WordPress, utilizing converter plugins would be an excellent idea. These plugins simplify the entire process while lowering the requirements for manual coding. Follow these steps to get it done.
Step 1: Installing the Plugin
Open WordPress and click on the Plugins option. Now, click on the Add New option and search for the HTML Import 2 plugin. Install and activate the plugin.
Step 2: Preparing For the Import
Now, visit the Settings menu and click on the HTML Import option. This plugin allows you to import multiple HTML pages simultaneously. You can also import one page at a time. By default, the plugin will show a specific import path, i.e., html-files-to-import. You can change it as per your requirements. Besides, you will have to configure the following information:
● Directory to import
● Default file
● Old site URL
● Directories to exclude
● File extensions to include
● Preserve file names
Then, you need to go to the Content section and choose the HTML elements carrying the content of your site.
Step 3: Start Importing Your Files
Once you are done configuring the import process, save the settings. After that, the Import Files button will activate. Click on that to start the process. If you don’t find the button, you can visit the Tools section and click on the Import option. There, you will find the Run Importer option. Click on that.
Next, select whether you want to import a single file or a directory of files. Click on the Submit button.
Once done, you can see all your existing HTML content on your new WordPress website.
Automated conversion tools’ limitations and the complexity of manual HTML to WP conversion can be overwhelming. This is where hiring an HTML to WordPress conversion expert can be an ideal option. With them, you can avoid challenges and enjoy significant advantages such as:
➔ Future Proofing - They can offer scalable solutions to make your website future-proof, and it can easily accommodate the increasing amount of traffic.
➔ Time Savings - You can focus on your primary business activities while experts handle the conversion task.
➔ Expertise and Efficiency - Professional developers use best practices and techniques to optimize your site’s security and performance.
➔ Custom Theme - Experts can create custom themes, bringing more flexibility and features to your newly converted website.
With this method, you may deal with high upfront costs, but you will find it cost-effective in the long run as you will avoid common mistakes that may arise during manual conversion.
Also read: Figma to WordPress: Top 3 Ways to Convert Your Figma Design into a WordPress Website
During this conversion process, you may face some common problems. Here are some potential issues and effective solutions you can consider.
If the CSS styles are not converted properly, carefully check each file to detect errors and conflicts. If required, you can override and modify existing CSS styles.
If the photos are appearing correctly and still you are getting an “unable to display” issue, then you need to check the image paths in the WP theme. Make sure that the image paths are connected to the directory of the theme.
In some cases, the template hierarchy of your WP theme may not work properly. In such cases, check the documentation of the template hierarchy and make sure that all the files are placed and named accurately.
Not all the plugins will work with WordPress themes. So, you can disable plugins one by one to detect the culprit. Don’t forget to update the plugins to their latest version.
Once you are done with converting the HTML design to a WordPress theme, you can use different useful plugins to enhance the site’s functionality and other aspects. Some crucial plugins you can try are:
● WP Super Cache- Use it to boost the website’s speed.
● Yoast SEO - A perfect tool to optimize website content to rank higher in search engines.
● WPForms - An excellent tool to create interactive and powerful forms for your site.
● WooCommerce - Use it to create an eCommerce store with a few simple clicks.
● Elementor - Use its drag-and-drop methods to create and edit your website.
When using a WordPress development website, it is crucial to maintain backups of your site and check security. To automate the backup process, you can use plugins like BackupBuddy, WP Time Capsule, or UpdraftPlus. To ensure maximum security for your new site, use plugins such as JetPack, WordFence Security, or SecuPress.
Properly check every single template after the conversion to ensure functionality and consistency in the design. This covers cross-browser testing, checking compatibility with plugins, and verifying template hierarchy.
Also Read: How to Hire a Dedicated WordPress Developer: A Complete Guide
Switching to a responsive WordPress theme from an HTML design can offer you a lot of options, including enhanced functionality and management. With WordPress, you will enjoy smooth content updates, customization flexibility, and easy maintenance. As you can see, there are multiple methods to convert HTML sites to WP design, and each method has its pros and cons. To make the entire process easier and quicker, you can utilize plugins.
If you are still feeling confused, you can always get the help of a professional developer from PSDtoHTMLNinja. Convert it now and take your business website to the new highest!
Yes, it is possible. For that, you need to keep the website’s permalink structure intact. Even though you can opt for a redirect link, keeping the same URL is advisable. If required, customize the existing URL structure to match the URL of the old HTML website. This can be done by visiting Settings and then clicking on Permalink.
If not done properly, you may face security and performance issues. Furthermore, you may lose important data from the HTML site.
For this, you need to upload your zipped HTML files to the server. Then, use the file manager available on the server to open HTML files.
By converting your HTML site to WordPress, you will witness an easy content management process. Besides, it is flexible and scalable. WP also offers many built-in SEO features to make your site rank higher. Furthermore, using various WP plugins, you can enhance the website’s functionality.
The conversion can be done using different plugins. However, basic coding skills can help you a lot in this process.
Yes 100%, you can definitely take advantage of built-in features like customizable URL structures, meta tags, and SE plugins such as Yoast or AIOSEO to optimize the website for SEO.