What happens if the meta tags are present in the document?

I am working on an ASP application, and the code, template, and files are organized in such a way that I cannot modify anything outside the body tag. So Iโ€™m thinking about inserting meta tags inside the body - like this:

<!-- FEW ASP INCLUDES --> <html> <head> <!-- FALLBACK TITLE AND DESCRIPTION --> <title>Default Title</title> <meta name="description" content="Default Description"> </head> <body> <!-- SOME HTML MARKUP --> <div class="dynamic-content"> <!-- InstanceBeginEditable name="dynamic-content" --> <!-- THIS IS WHERE I CAN WRITE ASP CODE --> <title><%= Page.Meta.GetTitle( yada, yada ) %></title> <meta name="description" content="<%= Page.Meta.GetDescription( yada, yada ) %>"> <!-- InstanceEndEditable --> </div> <!-- SOME MORE HTML MARKUP --> </body> </html> 

I am wondering how to place meta tags well inside the body of an HTML document. How does it affect:

  • search engines
  • browsers
+52
html seo meta-tags templates asp-classic
Sep 19 '09 at 5:26 a.m.
source share
9 answers

This, of course, is invalid according to HTML4.01. META tags are only allowed in HEAD (just like TITLE, for example), so by putting it in BODY, you essentially create invalid markup.

From a quick test, it seems that some browsers (like Firefox 3.5 and Safari 4) actually put these elements in HEAD when creating the document tree. This is not surprising: browsers are known to tolerate and try to interpret all kinds of broken markup.

Having invalid markup is rarely a good idea . Custom browser processing can lead to various inconsistencies related to migration (and behavioral). Instead of relying on browser guessing, it's best to follow the standard.

I donโ€™t know how search engines react to such soup soup, but I would not risk experimenting to find out. Perhaps they simply parse the HEAD tag for specific information and skip tags that contain BODY. Or maybe they believe that these are some attempts by malicious gambling and blacklists containing such markup. Who knows.

Bottom line - Avoid this whenever possible.

+40
Sep 19 '09 at 6:11
source share

The bottom line is to avoid this when possible, when DOCTYPE prohibits it. I think this is definitely allowed in HTML5 and very useful in cases using microdata. Example: http://schema.org/Event

+28
04 Oct 2018-11-11T00:
source share

I would not do that. This is not where these tags go, and search engines may view it as spam. If you can reorganize the home page, you can always add the content owner to the chapter section. I did it trivially:

 <asp:ContentPlaceHolder ID="HeadTags" runat="server" /> 

This way you can add any content that you like in the header section of your page:

 <asp:Content ID="Whatever" ContentPlaceHolderID="HeadTags" runat="server" > <meta ... > </asp:Content> 
+7
Sep 19 '09 at 6:03
source share

If your goal is search engine optimization, then it's probably a good idea to follow the standards and put all your meta tags in <head> . However, as far as browser behavior is concerned, if you put <meta> tags in your <body> , they will still work. I decided to test this using several <meta http-equiv="refresh"/> tags and <title> tags in another standard document.

The results of my tests:

Firefox 18, Firefox 3.6, Firefox Mobile, Chrome 24, Chrome for mobile devices, Opera 12, IE6, IE8, IE10:

  • Processed <meta> tags in the body.
  • The first <title> in the document was processed, even if it was in the body. Subsequent <title> tags were ignored.
  • The earliest meta refresh directive took effect, implying that both are processed.

IE9:

  • Same as above, with the exception of all the <title> tags in the body that were ignored.
  • IE10 in IE9 standards mode also behaves as follows.
  • IE9 in IE8 standards mode behaved the same as IE8, allowing the <title> tag in tag 1.

So what happens when you use meta tags in the body? By and large, they seem to be working fine. Meta tags are likely to be processed, so if you cannot put them in your head, I will not worry too much.

+5
Jan 24 '13 at 17:01
source share

Some meta tags intended for search engines will not be performed by search engines in the body section of the page.

For example, Google says that it will not respect rel = canonical in the body of the page, but only in the page title. Here's what Matt Cutts of Google says :

We do not allow rel = canonical in BODY (because, as I mentioned, people will spam this)

+3
Mar 19 '13 at 23:56
source share

I would say that you use it. I found meta tags inside the body on different web pages, and they are in one of the first 10 searches (google). This shows, at least to me, that search engines don't mind if you used this approach.

You must go forward if there is no other way.

+2
Jan 05 '13 at 10:29
source share

I put some meta tags in my body, but this is due to Microdata technology. When I do not have a regular element with information, I need to describe the object according to the schema.org dictionary, I set the meta tag with this content. Instead, I prefer to do this to set the item to display: none. As with the display: nothing can cause more problems with Google instead, as far as I know. I agree that this is not the best practice, but when I check my document (HTML5), I pass the check with zero errors. I also did this trick for several projects, and none of them had problems with Google or another search engine. Even microdata improves search engine rankings. I donโ€™t know what exactly you want to do with these meta tags in the body, because I did not see any microdata in your code. If you need this for this approach, I think that everything is in order, but in other cases the meta elements should be in the main section!

0
Jun 21 '13 at 9:44
source share

The presence of the META Description tag on websites is not valid markup, but this is not a big problem, as search engines can regularly find the tag wherever it is. My site does this, take a look at my HTML

http://cameras.specced.co.uk/compare/268/Canon_EOS_200D

META is located on the BODY website, however it was indexed by Google, and the meta description of the page was configured as text with a click in the Google search results.

0
Jul 22 '17 at 13:03
source share

meta tags can be added anywhere in HTML.

Scanners can read them, but the only problem is that you have to share your pages through some kind of application, such as Facebook Messenger, WhatsApp, etc.

These applications read only meta tags present inside the head tag . Thus , the properties of the og: image, og: description meta tag , if placed inside the body tag , are not readable and, therefore, will not be displayed when used together in such applications.

If this is for SEO purposes only, you can add the meta tag anywhere, but it is recommended that you add it only inside the tag header

0
Jan 18 '19 at 5:32
source share



All Articles