Yoast SEO X Tags: Functional specification
This documentation provides technical information about which X tags Yoast SEO generates and outputs. These tags are only consumed by X.
We output a variety of <meta>
tags for X in the <head>
of each page, in order to better inform X about the content of the page in question.
Note that for a lot of tags, X falls back on OpenGraph metadata. Where it falls back, we provide the OpenGraph metadata and don't provide the X tag specifically unless it has been customized.
X metadata
The following tags provide social networks and platforms (e.g., Facebook, X, Pinterest) with additional information about the page and its content.
Assuming that the respective admin settings are not disabled, these tags are output on all pages (except for error templates, which are described separately).
Tag | Description |
---|---|
twitter:card | The card type to use when previewing the page (defaulting to summary_large_image ). |
twitter:site | The X handle of the site owner/operator. |
Conditional tags
The following tags are only output when their conditions are met:
Tag | Description | Notes |
---|---|---|
twitter:creator | The X handle of the content author. | Only populated when the content author has a valid X handle. Only populated on post types. |
twitter:title | The title of the page, specifically for sharing on X. | Only populated when a specific value (which is different from the og:title value) is defined for X. |
twitter:description | The description of the page, specifically for sharing on X. | Only populated when a specific value (different from the og:description value) is defined for X. The hierarchy for this is as follows:
|
twitter:image | The URL of the primary image of the page, specifically for sharing on X. | Only populated when a specific image (different from the og:image ) is defined for X, or, when Facebook / og:image tags are disabled.
|
"Enhanced Slack sharing" tags
We utilize X's "label/data" meta tag format to add additional data, which is shown when sharing URLs on Slack. Note that this should only be output if the "Enhanced Slack sharing" setting is enabled for the site.
Tag | Description | Notes |
---|---|---|
<meta name="twitter:label1" content="Est. reading time" /> | Only output on post and page types. | |
<meta name="twitter:data1" content="%x% minutes" /> | Where %x% is the estimated reading time, rounded down to the closest minute. |