4

I was recently trying to configure a Google Webmasters Tools account for a client. I spent almost an hour wondering why I couldn't get the site to validate, when I found that the opening tag was missing from header.php.

The site is for a fairly large organization, but Google wouldn't even display the site when the organization's name was searched on. I was wondering if the faulty header.php could be to blame? I'd like to know if that's true, as that would be good for the client to know for certain reasons.

4

Google will index anything it can regardless of what errors/issues it contains providing it doesn't explicitly instruct Googlebot not to crawl.

With a missing <head> section, anything such as the page title, meta tags, stylesheets and javascript calls etc will all be missing - this will cause a lot of issues in terms of how the site performs in organic search. Without seeing the site in question, it is difficult to advise further.

  • 2
    This is probably the best answer. Web browsers are super flexible in their renders/compiling of whatever you throw at them since so many people are out making websites and the standards and functions of the browsers change so often. As a result you can write fairly sloppy code and still get something that works. CSS and other assets could still load without a <head> tag but you're taking some big risk. Google will still crawl the page content regardless and try to make something of it though. It might not be as good of results and thus effect search rankings but it will still crawl the site. – Jem Jul 1 '14 at 15:01
  • A head tag is optional so will not affect anything. – Rob Jul 1 '14 at 23:29
  • @Rob - Of course it will affect something. Otherwise it's pointless markup. – zigojacko Jul 2 '14 at 7:24
  • @Rob: <title> tag (which is in the <head> section) is one of the best spots for SEO. If you omit it, you lose some potential SEO value. – Zistoloen Jul 2 '14 at 12:01
  • @zigojacko See my post and read the spec. The head tag is optional. – Rob Jul 2 '14 at 18:04
1

Does Googlebot care about valid HTML?

In this YouTube Video, Matt Cutts says that the crawler is built to deal with HTML syntax errors.

Google does not penalize you if you have invalid HTML.

Google places more emphasis on quality content not HTML syntax.

So I do not expect a faulty <head> tag to be the only reason for the site not being included. Given this error, perhaps there are other errors that may be blocking the bot, such as your robots.txt file, rewrite rules or browser detection code.

I would check the servers logs to see if Google is in fact visiting your site.

Then check your markup and use Fetch as GoogleBot to test the site.

1

It seems very likely that google will parse the site, like any browser they will try to ignore and work around many errors that their spider has to encounter on the many many sites that they spider.

That's not to say that it won't depress your rank drastically, as such a broken problem probably will.

As far as not being indexed at all, that certainly sounds like you should look for a /robots.txt for the site to ensure that it's allowing spidering and indexing. Some older versions of wordpress made it easy to toggle on a robots.txt that recommended that all spiders not spider the blog. So I'd certainly look into your example.com/robots.txt location first.

You should also check whether the site is not being indexed at all, or just being ranked very low (which missing <head> would contribute to), by searching using a site:example.com search to specifically find results indexed using the site's url.

0

Google does index sites with 'invalid' html. You can see if the pages are indexed by doing a site:search as it could be that the pages are indexed, but just not ranking very well.

0

You will definitely require the head tag as its required to verify your website for Google web masters.

This is especially the case for Google Analytics:

Paste your snippet (unaltered, in it’s entirety) into every web page that you want to track. Paste it immediately before the closing </head> tag.

Source: Set up the web tracking code - Analytics Help

and the meta tags are declared in <head></head> part too this is not good for SEO especially this is where Google looks for information regarding indexing

  • Numerous inaccurate comments in this answer. Firstly, verification in Google WMT is not required to index a website (plus there are additional methods to verify). Secondly, the Google Analytics tracking code does not have to be inserted into the <head> necessarily. Thirdly, the meta tags are mostly not used in the slightest for ranking web pages. – zigojacko Jul 1 '14 at 19:54
-1

The head tag is optional so nothing cares and it doesn't matter in most cases.

-2

Im not sure about the head tag itself, but meta tags inside the head section will affect google search results, see this link for more details: https://support.google.com/webmasters/answer/79812?hl=en

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy