Use Twitter Profile Picture direct URL as Twitter:Image?




I’m finishing the new website of my Twitter game @whattheshot where a snapshot of a movie is published and users have to guess the title of the movie. I’m encountering a problem with Twitter Cards for a specific kind of pages: the user profile page. Each of my players will have its own page with its Twitter avatar/banner, and some statistics about him in my game.

I wanted to create a Twitter Card for these pages just like I did successfully for the rest of my website, but in this case, the preview image doesn’t appear. As this is a profile page, I naturally used their Twitter Avatar as preview image in the Twitter Card, but it seems Twitter doesn’t allow me to use the direct URL of the avatar? (maybe to avoid people getting confused between a twitter card and a real (RT)tweet?).

My Page:
The direct link to the Twitter Avatar of my user:

The image loads correctly in the page, and in my browser, but not in the Twitter Cards Validator:

I checked with curl -A Twitterbot and meta datas appear at the top.

That will make sense if Twitter forbids the use of Twitter Avatar as preview images, but I just wanted to have the confirmation before finding a solution.

Thanks a lot!



I see this in your page:

<meta name="twitter:image" content="|replace:'bigger':'400x400'"/>

Try changing that to the URL you provided in your post above. Those URL parameters in the image URL are probably causing issues.


Hi Andy. Thanks, I fixed the URL. Unfortunately, the preview image doesn’t appear.

Here is another user Profile (just to avoid cache issues on the other one) :

URL in twitter:image is fixed, appears correctly in curl, but still nothing in the Card Validator.


Well hmm - I’m surprised that didn’t help. I don’t see a reason why the profile images would not work. I guess given they could be updated often it might not be a great way to implement this anyway, with the cache etc. Do you have any alternative ways to host the images? Maybe grab the current profile image and store locally when the user sets up an account?


Yeah this is odd. I can definitely save the images locally and use them but if I could avoid saving profile pictures of all my players “just” for a Twitter Card, that would be great :smile:

But I guess that’s the only solution for now yes, or just use a default twitter image.

Thanks for your help though. If by chance you find the reason of this behavior, don’t hesitate to contact me, I’m curious!




This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.