Stay organized with collections Save and categorize content based on your preferences.

Use valid HTML to specify page metadata

Using valid HTML for page metadata ensures that Google can use the metadata as documented. Google tries to understand HTML even when it is invalid or inconsistent with the HTML standard, but errors in the markup can cause problems with how your metadata is used in Google Search. The primary element for specifying metadata about a page is the HTML <head> element. If you use an invalid element in the <head>, Google ignores any elements that appear after the invalid element.

Use valid elements in the <head>

Only place the following HTML elements inside the <head> element:

  • title
  • meta
  • link
  • script
  • style
  • base
  • noscript
  • template

Don't use invalid elements in the <head>

No element other than the aforementioned is permitted by the HTML specification in the <head>. Common elements that appear in the <head>, rendering it invalid are:

  • iframe
  • img

We strongly recommend that you don't use these invalid elements in the <head>, but if you must, place these invalid elements after the ones you want Google to see. Once Google detects one of these invalid elements, it assumes the end of the <head> and stops reading any further elements in the <head>.