I am working on a ASP application and the code, template and files are organized in a way that does not allow me to alter anything outside the body tag. So I am thinking abo
meta tags can be added anywhere in the HTML.
The web crawlers can read them but the only issue is when you have to share your pages over some application like facebook messenger, whatsapp etc.
These applications only read meta tags present inside the head tag. So, the og:image, og:description properties of meta tag if placed inside body tag are not read and hence won't be displayed while sharing in such applications.
If its only for SEO purpose, you can add meta tag anywhere but it is recommended to add inside head tag only
If your aim is search engine optimization, then it is probably a good idea to follow the standards and put all your meta tags in the <head>
. However, as far as browser behavior goes, if you place <meta>
tags into your <body>
they will still function. I decided to test this using multiple <meta http-equiv="refresh"/>
tags and <title>
tags in an otherwise standards-compliant document.
The results of my tests:
Firefox 18, Firefox 3.6, Firefox Mobile, Chrome 24, Chrome for Mobile, Opera 12, IE6, IE8, IE10:
<meta>
tags in the body were processed.<title>
tag in the document was processed, even if it was in the body. Subsequent <title>
tags were ignored.IE9:
<title>
tags in the body were ignored.<title>
tag in the body.So, what happens when you use meta tags in the body? By and large, they seem to work fine. The meta tags will probably be processed, so if you can't put them in the head then I wouldn't fret too much.
I have put some meta tags into the body, but that is because of the Microdata technology. When I do not have a regular element with the info, that I need to describe the object according to the schema.org vocabulary , I set a meta tag with this content. I prefer to do it that way instead, to set an element with display:none. The way with display:none may cause more google problems instead of this, as far as I know. I agree it is not the best practice, but when I validate my document (HTML5) I pass the validation with zero errors. Also I have done this trick for a several projects and none of them has problems with google or other search engine. Even microdata improve the search engine ranking. I don't know what exactly you want to do with this meta tags into the body, because I have not saw any microdata in your code. If you need it for this approach I think it is ok, but in other cases meta elements must be in head section!