How to fix: Bad value twitter:url for attribute name on element meta: keyword twitter:url is not registered.

Most Likely Cause and Fix

Your HTML5 markup contains a Twitter Card meta element that uses a currently-invalid value for the name attribute:

<meta name="twitter:url" content="foo" >

Use the HTML5 meta property attribute instead:

<meta property="twitter:url" content="foo" >

What This Error Means

Some element attributes can take pretty much any value, others can take only values of a certain type and others still can only take a value from a pre-defined set.

This error relates to the following usage in your markup:

<meta name="twitter:url">

The error is stating that, in this context, the attribute name on element meta is not allowed to take the value twitter:url

The validator is giving the reason: keyword twitter:url is not registered.

How To Fix It

For Twitter Card meta elements in HTML5 documents

The Twitter Card documentation states that you should add meta elements to your markup in the form:

<meta name="twitter:url" content="foo" >

Under HTML5 the name attribute must be one of a pre-defined set. The above markup will not be valid until the relevant value (twitter:url) has been registered.

Swap the name attribute for an otherwise-identical property attribute to create valid syntax that is recognised by Twitter.

<meta property="twitter:card" content="summary">
<meta property="twitter:site" content="simplytestable">
<meta property="twitter:title" content="Title Here">
<meta property="twitter:description" content="Description Here">
<meta property="twitter:creator" content="simplytestable">
<meta property="twitter:image:src" content="http://placehold.it/350x150">        
<meta property="twitter:domain" content="simplytestable.com">

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus