Validation is simply ensuring that your blog site has HTML that is error free. In this HTML validation of your Blog Site : How to guide, we shall look into the various aspects of validation and why it is such an important issue.
W3C and Validation
The World Wide Web Consortium (w3.org) formulates rules that govern HTML coding. The site also provides all the tools you will need to validate your blog site. Apart from the W3C, there are other applications and sites that can check your code either online or on your computer. The parameters used, however, are those defined by the W3C.
What Validation Does not Guarantee
Making your blog site code error free does not guarantee that it will be rendered perfectly on all browsers. That requires a cross-browser check: a trial and error method to determine what format of code is rendered in the desired manner by all or most browsers.
Modern browsers are equipped with the capacity to ‘guess’ the best possible solution to a missing piece of markup. Most of the time you can get away with invalid code. This raises questions regarding the necessity of validation. It is fine for coders to make their work flawless, but for the average webmaster with a blog site, how does it matter? Visitors can see the web page just fine!
Actually, browsers mostly do not agree with each other while taking their ‘best guesses’. An invalid markup can be rendered in any number of ways depending upon what browser your visitors are using. An error in an HTML form, for example, could cause your blog’s squeeze page to stretch horizontally so that the form is not visible without scrolling. Less extreme possibilities include unexpected line breaks and text decorations.
Apart from this, when a blog site has too many errors, the browser’s ‘guessing time’ translates to extra loading time for the site, and nothing drives away visitors more than a web page that takes forever to load. Even the server is burdened with repeated queries as the browser tries to figure out a way to render the page.
Another disastrous effect is that search engines, who are less forgiving than browsers, might give up on the guessing game and stop indexing your pages altogether. Invalid markup does not create a good impression upon anyone, be it a search-bot or those among your visitors checking out your source code.
Case Study: HTML Validation of Your Blog Site on WordPress
WordPress uses PHP to render web pages on the fly. In other words, what you see by viewing the source code in browser is not really there in that exact form. You will need to access the theme editor through the dashboard if you want to validate anything. There will be a number of files available in that area, and you will need to copy the code from each and paste it into the W3C validation tool. The tool also supports upload of files (web pages) and url detection.
Errors, if any, will be highlighted in the report that you receive. Problem is, when you see a certain number of errors mentioned, 13, for example, there may be only 3 or 4. This happens because ‘nested’ code is also included in the error count. This problem goes away once you correct the codes. Frequently, however, you will find an error indicated in a line which is perfectly coded. The trick is to ‘look before and after’ – the previous line could have a closing tag missing. Understanding the validating tool’s behavior makes correcting errors a less daunting task.
You could resort to other sites for an alternate perspective on the problems. The WDG HTML Validator, for example, refers to its own pool of resources so that explanations regarding errors are a little different from the W3C’s. You could also use an add-on or an extension in case you are using Firefox or Chrome, respectively, to check your site’s pages as you are visiting them. This is a little more user friendly, and should provide you with further insights when you deal with the theme editor.
All reputed themes have expert coding and should contain very little error. If you take the time to study basic HTML and use more than one validation tool, HTML validation of your blog site should not be too different from proofreading your own posts.
Release ID: 1848