Search code examples
htmlseosearch-engine

Long attributes in the meta tag


I have a meta tag for description:

<meta name="description"
      content="a very very long string that is rather boring" />

Is it OK to put the content on multiple lines so that it is readable for editing? Is this true for all browsers and search engines?


Solution

  • Is it OK to put the content on multiple lines so that it is readable for editing?

    Yes.

    Is this true for all browsers and search engines?

    Yes.

    So long as the content is valid attribute content, you will be fine with this.

    HTML 4 defines the content attribute as CDATA:

    CDATA is a sequence of characters from the document character set and may include character entities. User agents should interpret attribute values as follows:

    • Replace character entities with characters,
    • Ignore line feeds,
    • Replace each carriage return or tab with a single space.