I want to change the main photo in a web page, I just have the url page. So I decided to use the meta written for Facebook sharing.
I want to change the image in: meta property="og:image" content="http://myweb.com/image.jpg"
You can change og:image with following code: $('meta[name=og\\:image]'). attr('content', newVideoUrl); But, if you want to change the image permanently (so Facebook can scrape your data and the image will be available for sharing), you need to change this value on the server.
Go to the page in question, click Properties > Metadata and update the metadata with the fields you want to dynamically display.
An open graph image or OG image is the image that appears when you post a link to a web page or video content on your social media page. This forms part of an important group of meta tags that directly impact how the content links perform on social media platforms, like Facebook, LinkedIn and Twitter.
Change it with jQuery like:
$('meta[property=og\\:image]').attr('content', 'http://myweb.com/image.jpg');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With