Twitter Widgets Webpage Properties¶
Websites can set widget preferences across their entire website by including
Widget settings specified in a
<meta> may be overridden at the individual widget level. Order of precedence:
- web intent link query parameter
- widget attribute
- widget ID stored preference (embedded timelines only)
- meta or link element
Identify the Twitter profile of the page¶
via property of a Tweet Button by linking to your Twitter profile page with a
me link relationship token.
me link relationship in the
<head> section of your webpage.
<link rel="me" href="https://twitter.com/TwitterDev">
You may also set a
me relationship from an anchor element on your page, such as a Follow Button.
<a class="twitter-follow-button" rel="me" href="https://twitter.com/TwitterDev"> Follow @TwitterDev </a>
<meta name="twitter:widgets:theme" content="dark">
theme = dark
Specify a border color for any Embedded Timelines displayed on the page.
<meta name="twitter:widgets:border-color" content="#ff00ff">
Do not track¶
Twitter may use website impression data to tailor Twitter experiences including suggesting accounts to follow. Your website can choose to opt-out your audience from tailored experiences informed by the content of your site by setting
<meta name="twitter:dnt" content="on">
Disable functionality which may trigger Content Security Policy warnings¶
An Embedded Tweet or Embedded Timeline may display with restricted capabilities when a Content Security Policy restricts inline loading of Twitter. Set
csp=on to disable functionality which could display Content Security Policy warnings on your site.
<meta name="twitter:widgets:csp" content="on">