: HTML5 doctype & SEO I am trying to get my pages validated using Markup Validation Service on W3C validator. We are getting validation against the XHTML 1.0 Strict doctype comes back with the
I am trying to get my pages validated using Markup Validation Service on W3C validator.
We are getting validation against the XHTML 1.0 Strict doctype comes back with the following error:
[…] there is no attribute "data-gid"
Because of the following code:
<a href="#" class="addToCartLink" data-gid="202">Add to Inquiry List</a>
We have been advised that we need to use the HTML5 doctype. We have changed to the above doctype on this page now however the point of this excercise was to make sure the site is clean to help with SEO.
I would like to use the HTML5 doctype with HTML5 markup.
Here is the question: Is there any difference, from SEO perspective, between valid HTML5 or XHTML 1.0 Strict? Should I try to stay on (valid) XHTML 1.0 Strict doctype/markup or is it OK to move to valid HTML5 doctype/markup?
More posts by @Ravi8258870
1 Comments
Sorted by latest first Latest Oldest Best
You need to familiarize yourself with DOC-TYPE markups.
At the moment your attempting to use both HTML5 and XHTML which is not possible, its one or other.
So at the moment you using:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
For HTML5 it should look like:
<!DOCTYPE html>
If you want it to Validate in XHTML 1.0 Transitional then it should look like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Data-GID HTML5
The attribute data-gid is only valid in HTML5 so your pages should only use <!DOCTYPE html> if you want to validate your pages in XHTML then you need to remove the data-gid attribute and use another attribute that is supported in XHTML. Your pages validate absolutely fine when using HTML5 validation, so your only problem is that you need to remove: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> as this line is not required for HTML5 markup.
SEO Factors
There is no major or minor SEO value in using XHTML or HTML5 markups, as long as the page validates then Google, Bing and Yahoo will process your data without problems. The good thing is that your page is validating with HTML5. Time to focus on other things ;)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.