Published: Friday, April 28, 2017, Updated: Friday, March 01, 2024

Convert HTML to Blogger XML Theme Tutorial [4 Steps]

Make your own developed and designed Blogger/Blogspot theme or template and this tutorial will help you about how to convert HTML to Blogger Template or XML Theme in the easiest way ever!

Convert HTML to Blogger XML

This Tutorial is for:
  1. If you want to install or use HTML template in Blogger.
  2. If you want to install or use your own designed and developed Blogger template.

How to make Blogger template?

So you are waiting for converting your HTML template into Blogger XML Template or Theme. 

Really it is thrilling of having your own designed and developed Blogger Website or Blog. 

When I had published this tutorial first, there was no enough and comprehensive resources to learn Blogger Theme Development. I learned myself from Google officially themes. 

After learning HTML, CSS, JavaScript I was trying to learn how Blogger XML code work. Initially, I could customize some changes like adding the new widget, changing some code etc. 

One day I took decision to learn Blogger XML Theme. As I told, I searched on Google for the conversion HTML to Blogger. With the results I was hopeless but wasn’t so disappointed. 

Finally, I have made my own designed and developed Blogger theme! 
Convert HTML to Blogger XML Theme Tutorial

This is my short story about learning Blogger Theme. Actually, I wanted to help others who want to know and learn how to convert HTML to Blogger XML easily and really it is so easy to convert than other Content Management System (CMS) such as Wordpress, Drupal, Magento etc.


Before starting the conversion of Blogger Theme, you need to know the following basic concept:
  • Blogger doesn’t support more than one file or any directory. So make a single HTML file where you have to put all code. That means, you can’t put CSS, JavaScript code in different folder or file, you have to put all code into one file. 

  • Blogger supports the only XML to convert. So you have to rename your HTML file (with .html extension)  into XML (with .xml extension). But it is not required to know the advance concept about XML. You can start without any knowledge about it.

  • Don’t afraid to see them as much complex code in other Blogger template. You will be happy to know that most of the codes are generated by Blogger automatically after installing the template.

4 Steps to Convert HTML Template into Blogger XML Theme

Before starting the conversion, backup your HTML file to others.
  1. Open your code editor (Personally I use VS Code) and paste your HTML code here and save as themename.xml (rename what you want but with .xml extension).
  2. Cut the all code till <head> tag to above and paste the following code.
      <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html><html class='no-js' xmlns='https://www.w3.org/1999/xhtml' xmlns:b='https://www.google.com/2005/gml/b' xmlns:data='https://www.google.com/2005/gml/data' xmlns:expr='https://www.google.com/2005/gml/expr' xmlns:og='https://ogp.me/ns#'> <!--<![endif]-->
    <head prefix='og: https://ogp.me/ns# fb: https://ogp.me/ns/fb# article: https://ogp.me/ns/article#'>
  3. Find </head> tag and add the following code just before it.
      <b:skin><![CDATA[
    /**PUT YOUR ALL CSS HERE**/
    ]]></b:skin>
  4. Body Customization: Probably you have seen the layout dashboard like below.  There are Favicon, Header, Main, Sidebar, Footer section. It will be shown if we make it, otherwise, it will not be shown.
    Favicon is created automatically. So we have to create others.

    But we need to know the differences between section and widget in Blogger.

    The section is the scope or area where one or more widget can be placed. To add widget we need not add in code, we need to add just section.

    To know more details about the differences between section and widget read this article.

    And read this to know the similarity between section and widget.

    How to Create Section Blogger

    To create a section you need to write the following code.
    <b:section></b:section>
    But it is not enough to show section in Blogger dashboard layout. You have to define the name, unique class, id, how many widgets you want to add to this section. To do this you have to write this with more attribution like below.
      <b:section class='section_name' id='section_name' maxwidgets='1' showaddelement='yes'></b:section>

    You have to put section code within specific div. But remove all image, anchor, text, header before pasting.

    Learn more about section.

    Header: It is required to keep a header section in Blogger theme. Blog name/Logo is shown here. So create header section within your logo div.
    Put the following code within your logo div.
      <b:section class='header' id='header' maxwidgets='1' showaddelement='no'><b:widget id='Header1' locked='true' title='' type='Header'></b:widget></b:section>

    Main: Now find the div area where you want to show post, article.
    Now put the following code within the article or main div.
      <b:section class='main' id='main' showaddelement='yes'>
    <b:widget id='Blog1' locked='false' title='Blog Posts' type='Blog' version='1'>
    </b:widget></b:section>

    Learn What is Widget and how to use?

    Sidebar: Put the following code within sidebar div.
      <b:section class='sidebar' id='sidebar' preferred='yes'></b:section>
    Footer: Similarly Main and Sidebar do for Footer. Put the following code within footer div.
      <b:section class='footer' id='footer' preferred='yes'></b:section>
    If you need to add more section, you can add.

Now you are ready to install your first own developed Blogger Theme. Upload your XML theme and see what changes.

Remember it is not enough to develop properly. You have to customize the followings next.

New: You can convert WordPress Theme to Blogger easily now!


Read: How to create responsive Blog HTML Template.

Another article to convert Blogger template to HTML.

Video Tutorial: If you fail to Convert HTML to Blogger XML Theme, I recommend to enroll this video course - Udemy: Google Blogger Theme Development Tutorial.
Elliyas Ahmed
Elliyas Ahmed
Elliyas Ahmed, founder of COMPROMATH, is a Computer Science and Engineering graduate who excels in Blogging, Website Development, and SEO. He offers freelancing services to help clients succeed online. Learn more about Elliyas Ahmed.