saurssaurav
saurssaurav

Reputation: 773

Twitter card not working

My meta tags for twitter in site:

<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="....">
<meta property="twitter:title" content=".....">
<meta property="twitter:description" content="test description">
<meta property="twitter:image" content="....">

I even tried with twitter:image:url and also allowed twitter bot in robot.txt but no luck till now

Upvotes: 10

Views: 10946

Answers (5)

TwiN
TwiN

Reputation: 3834

Twitter's card validator would return No meta tags found for me until I added the Content-Type: text/html header to the server's response.

From what I gather, Twitterbot doesn't even try to parse the page unless the server responds with the Content-Type it expects to see, which is text/html in this case.

Upvotes: 0

Dharun Aashick
Dharun Aashick

Reputation: 11

Twitter share url

<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="....">
<meta property="twitter:title" content=".....">
<meta property="twitter:description" content="test description">
<meta property="twitter:image" content="....">

Share Url : <a href="https://twitter.com/intent/tweet?url=your_url">SHARE</a>

It will work only on https

Upvotes: 0

eFox
eFox

Reputation: 695

If none of the above works, try changing twitter:image to twitter:image:src and make sure that the image fulfills the size requirements:

smallest size supported

  • summary: 144x144px
  • summary_large_image: 300x157px

Largest size supported

In both cases the maximum is 4096x4096px and at most 5MB.

Upvotes: 0

Akshay
Akshay

Reputation: 197

Use name instead of property in you meta tags Like :

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="....">
<meta name="twitter:title" content=".....">
<meta name="twitter:description" content="test description">
<meta name="twitter:image" content="....">

Upvotes: 6

Karan Shah
Karan Shah

Reputation: 1324

May I know where did you test if the twitter card is working or not? Did you check with https://cards-dev.twitter.com/validator?

Also, sometimes the placement of the meta tags do matter, place them early in the head section but after the og (open graph) meta-tags.

Let me know what error you get(if any) on the card validator.

Upvotes: 3

Related Questions