If you've ever looked into your Blogger template code, you may have noticed extra attributes like xmlns
, data-version
, or id
. These are added automatically by Blogger and are usually not needed—especially if you're building a modern, lightweight theme. In this guide, you’ll learn how to remove them safely for better SEO, faster load times, and a cleaner codebase.
๐ What Are These Extra Attributes?
When Blogger generates your template, it includes XML namespaces and internal markers that look like this:
<html xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'
dir='ltr' lang='en'>
These namespaces are useful only if you rely on advanced Blogger features — otherwise, they add unnecessary clutter.
✅ Why Remove Them?
- Makes your HTML easier to manage and style
- Improves page speed and user experience
- Enhances SEO compatibility
- Creates a more professional and minimal look
✂️ Step 1: Clean XML Namespaces in <html>
Replace or override Blogger’s default <html> attributes using:
<b:attr name='xmlns' value='' />
<b:attr name='xmlns:b' value='' />
<b:attr name='xmlns:data' value='' />
<b:attr name='xmlns:expr' value='' />
Keep this structure intact for SEO and accessibility:
<html dir='ltr' lang='en'>
Tip: Use rtl
instead of ltr
if your blog uses a right-to-left language like Arabic.
๐งฑ Step 2: Clean Attributes in Blogger Widgets
Blogger adds internal id
, data-version
, and extra class
values to widgets. These can be overridden manually.
๐งช Default Widget Code
<b:widget id='FeaturedPost1' type='FeaturedPost' version='2'>
<b:includable id='main'>
<div id='FeaturedPost1' data-version='2' class='widget featured-post'>
<h2>Example Title</h2>
<p>Post summary goes here...</p>
</div>
</b:includable>
</b:widget>
✅ Clean Version
<b:widget id='FeaturedPost1' type='FeaturedPost' version='2'>
<b:includable id='main'>
<b:attr name='id' value='' />
<b:attr name='data-version' value='' />
<b:attr name='class' value='featured-post' />
<div class="featured-post">
<h2><data:title/></h2>
<p><data:post.snippet/></p>
</div>
</b:includable>
</b:widget>
This gives you full styling control and removes unnecessary internal Blogger attributes.
๐ Final Output
After cleaning, your HTML output will be simple and lightweight:
<html dir='ltr' lang='en'>
<head>...</head>
<body>
<div class="featured-post">
<h2>My Post Title</h2>
<p>This is a short post summary...</p>
</div>
</body>
</html>
๐ Conclusion
Removing unnecessary Blogger attributes is a quick way to modernize your template and improve its performance. Whether you're aiming for AdSense approval or just want a cleaner site, this process helps reduce clutter and enhances both user experience and SEO.