Valid HTML – does it matter or can you just ignore it?
If you’re keeping a close eye on the SEO scene, you might have seen this recent tweet from Google’s Gary Illyes:
“Dear JavaScript frameworks and plugins,
If you could stop putting invalid tags in the HTML head, like IMG and DIV, that would be great.
Yours truly,
Browsers”
The use of JavaScript frameworks in web development is a common practice. They are packages of codes that serve as building blocks for web apps and websites. Developers love them because they speed up the process and make it much more straightforward. Plugins, on the other hand, are add-ons that we often find attached to content management systems (CMSs).
Just to give you an example, Facebook sometimes requires from its advertisers that they add a tracking image code into the header on their websites. In fact, that code doesn’t belong in that section and can cause a series of HTML errors that ultimately have a negative impact over the efficiency with which Google indexes the website page.
That type of invalid HTML can put a website at risk. So what’s the deal with invalid HTML in SEO and how you can protect your site against it? Read on to find out.
Valid HTML – is it worth it?
If you look at Google support page about browser compatibility, you will find a statement that indicates invalid HTML to be okay.
John Mueller was recently asked whether valid HTML played any role in the indexing and ranking process and his response was clear: valid HTML is not as important as it appears to be.
The official statements from Google don’t give us any reasons to worry about HTML validation. In fact, most of the websites out there fail to validate, and the web is still working. However, by ensuring that your HTML is valid, you will be taking advantage of several significant benefits.
Here are 5 good reasons why it’s a good idea to validate HTML.
1. It could impact the crawl rate
Have a look at the Google search console support page about crawl rate drops. You will see that Google suggests invalid HTML could, in fact, affect the crawl and indexing all the website. Broken HTML code or unsupported content on pages may cause Googlebot not to parse it – and crawl it. If you’re curious how Googlebot sees your page, you can simply use Fetch as Google.
2. It might affect browser compatibility
In another support page, Google promotes the use of valid HTML to ensure that web pages are properly rendered. Googlebot generally renders a website as a browser, and to be exact the Chrome version 41 of the browser which dates back to March 15. If you include valid HTML code in your website, you will be making sure that it renders well across all browsers, including that version Googlebot uses for rendering sites. For example, note that CSS custom properties aren’t supported by the version Googlebot is using for rendering. Nothing works better than including clean and valid HTML code to ensure your page renders and loads fast.
3. Valid HTML brings great user experience
If you’re part of the SEO scene, you probably know that Google takes user experience into account and treats it as a serious signal during the ranking process. That’s why Google likes websites to be mobile friendly – they simply provide users with a great experience across devices. Google also counts how many pop-ups and ads are part of a webpage to understand the quality of user experience further.
Google probably doesn’t use valid HTML as a ranking signal. However, the presence of valid HTML might affect the user experience positively because the page will render quickly and accurately. And that in itself is a serious value. Valid HTML helps a website render well across different browsers, devices, and operating systems – and the user experience factor is essential to your page track.
4. It comes in handy for Google Shopping apps
You probably know the Google Merchant Center, a tool for creating shopping ads. If you have a look at that support page you will see that it recommends using valid HTML. Since Google detects the price displayed on the basis of the structure of your landing page, using valid HTML ensures that it shows the correct price.
5. Invalid HTML in the header section is quite risky
To put it simply, if invalid HTML finds its way into the head section of your website, Google won’t be able to pick up your Hreflang tags. Invalid code in this section can easily break Google’s crawl and result in the search engine not indexing the tags.
For example, Google might try to crawl and index the page, but when it renders it, something in the header might be added early on and break every single thing in the head section of the page – and that includes the hreflang markup.
Valid HTML matters
Taking a closer look at Google support pages should be enough to indicate that valid HTML is essential.
The tweet we mentioned at the beginning of this article serves as an important reminder of the value of valid HTML and why SEO experts should remember about validating to protect their pages from errors and boost their visibility. Coding a valid HTML website helps to prevent rendering issues that some browsers might take seriously. Moreover, the majority of these errors might prevent Google from properly crawling and indexing your website.
Perhaps these five examples are just extreme cases that don’t usually happen in the real world? Then again, some things remain unimportant until they suddenly start affecting the performance of your website, its user experience, and ultimately its rank in the search engine.
If you know that something could help and definitely won’t hurt your website, why not try it? By validating your HTML code you can sleep soundly knowing that Google doesn’t encounter any crawl errors and your page renders appropriately.
Have you got any questions about validating HTML? Do you think it’s worth to do it or perhaps it’s a little too much?
Give us a shoutout in comments; we’re always looking forward to hearing other perspectives and want to launch a conversation about validating HTML as an SEO practice.