Making image meta tag dynamic, twitter card not showing image

1.5k Views Asked by At

I need to tweet a text with an image.

If I put a static image, it is working. If I make the image dynamic, the image is not tweeting, nor is it showing up in card-validator.

Here is the URL :

https://www.advito.com/wp-content/plugins/aitdgcalculator/share.php?imageURL=5d5aad0810b27.png?544

The tweet is coming like this:

https://twitter.com/9032579978/status/1163701787192250368

How to make the image appear in the tweet ? I need to make the image dynamic, will that be possible through meta tags? or what options do I have ?

2

There are 2 best solutions below

0
On

I solved it by making the shared URL dynamic. I made sure, everytime, something is shared, the URL should be unique that twitter crawler, had never seen it.

1
On

For those looking at making the <meta property="og:image" content="DYNAMIC URL HERE" /> tag dynamic, one important note is that Twitter Validator, LinkedIn Inspector, etc. will fetch the HTTP meta tag during the initial rendering of the page.

If you use a script (JS,, jQuery, etc.) within the page to modify the content of the meta tag, the new picture will not show in Twitter or LinkedIn because the info in the HTTP header has already been fetched. To make the image dynamic, the URL must be injected before the initial rendering.