Issues

Social: X Cards Outside <head>

back to issues overview

X Cards Outside <head>

Pages with X Cards that are outside the <head> element. This means they can be ignored by X and not used for social snippets.

How to Analyse in the SEO Spider

View URLs with this issue in the ‘Social’ tab and ‘X Cards Outside <head>’ filter, and export all URLs using the ‘Export’ button.

Check to see if there are any ‘Invalid HTML Elements in Head’ under the ‘Validation’ tab, that could be the cause.

If this issue has also been triggered, use our ‘How To Debug Invalid HTML Elements In The Head‘ tutorial to debug.

What Triggers This Issue

This issue is triggered when a page has X Cards placed outside of the <head> element in the HTML.

Example:

<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@yoursite"/>
<meta name="twitter:creator" content="@author"/>
<meta name="twitter:title" content="Your headline"/>
<meta name="twitter:description" content="Your exciting description."/>
<meta name="twitter:image" content="https://example.com/image.jpg"/>
...
</body>
</html>

How To Fix

Ensure X Cards are included within the <head> element so they can be used by X.

Back to top