Today’s
article focuses on fixing W3C validation errors in Blogger XHTML template.
Bloglution has always shared quality post to make readers get most out of it in
easiest ways possible. In this post we would learn to minimize those W3C
validation errors, although it is nearly impossible to remove all of them but
we can fix about 95% of them in no time. When I checked Bloglution for the
first time I was shocked to see the results, it has 313 errors, I worked on it
and reduced it to only 11 errors. Almost all Blogger templates contain hundreds
of errors. These errors can cause crawl errors by search engine bots, resulting
improper crawling. Also it leads to slower page loading. Most of us are unaware
of these errors, and when we notice we got surprised by seeing hundreds of
them. Firstly let’s take a quick look on W3C before proceeding to our tutorial.
W3C-
It stands for ‘World Wide Web Consortium, the main international standards
organization for the world wide web. Their ultimate aim is the improvement of
online available documents for assuring quality to internet users. Secondly,
complying with them reduces browsers incompatibility issues. The Markup
validation service by W3C is a validator, which allows internet users to check
HTML and XHTML documents for well formed markup. Its impact on SEO is still not clear but
reducing them to minimum is always a good practice which definitely benefits
you. So, let’s start the tutorial.
Fixing
W3C Validation Errors in Blogger
The
first step towards fixing your W3C errors is to analyze them. Just go to W3Cvalidator, enter your blog’s URL and hit enter. You will be presented with your
validation report with your errors and warnings count. Now you know, how many
errors are there in your template. Don’t worry, follow the tutorial and you
will see the difference.
(1) Fixing DOCTYPE DECLARATION- This
is main root cause for most of the W3C errors, about 90% of your errors can be
fixed by declaring it correctly. Let’s see how.
(a) Go to your Blog’s dashboard.
(b) Click on ‘Template’ and then ‘Edit
HTML’.
(c) Find the below code using ctrl+f.
This code is present between <!DOCTYPE html> and <head> section.
<html b:version='2' class='v2'
expr:dir='data:blog.languageDirection' 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'>
(d) Replace the above code with the
below code.
<html b:version='2' class='v2'
expr:dir='data:blog.languageDirection' 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'> <html
xmlns:expr='http://www.google.com/2005/gml/expr'/>
(e) Remember to delete the Read more
link.
(f) Save your template.
(2) Fixing Quickedits- Quickedits are
another major culprit which hurdles W3C validations. Actually Blogger provides
us this quickedits as a facility for editing our blog directly from the front
view. You have also noticed that when you are signed in, these quickedit icons
are present on the right bottom of every widget. Removing them from our
template can reduce up to 30 % validation errors. For removing them:-
(a) Go to your blog’s dashboard.
(b) Click on ‘Template’ and then
‘Edit HTML’.
(c) Find the below two codes and
delete all of them.
<b:include data='post' name='postQuickEdit'/>
and
<b:include name='quickedit'/>
NOTE- This code occurs multiple times in your
blog depending upon the number of your widgets, remember to remove this code
each time to add a widget in your blog.
(3) Fixing
Blogger images- Fixing Blogger images refers to the addition of ALT and TITLE
tags. As I have already discussed them in detail in my previous article, adding
ALT tag in your images can benefit you in many ways such as better SEO which
help in driving more visitors to your blog. Not only that, images without ALT
tag generates XHTML errors and warnings. Just go through the below articles to
understand this topic clearly.
The above mentioned methods will minimize your
validations errors up to 95%. After applying the above mentioned steps, once
again go to W3C validator and check errors on your blog, definitely you will be
surprised by the results as few negligible errors are left. These are
unavoidable errors which cannot be fixed by us. They can only be fixed by the
Blogger team.
Do let us know how many of you have minimized them
and by how much?