I'm trying to update the meta content of the Facebook's Open Graph title. I updated the content, but when it published the feed, it's still pulling the old information.
Example:
<meta property="og:title" content="Title 1"/> I managed to update to <meta property="og:title" content="Title 2"/>
When I click on the Facebook Like, it's still pointing the title to "title 1".
How can I make it update?
You need to ping facebook and notify them to update changes and to do that you can use URL Linter. It may take some time for facebook to update your changes.
Just go to Page Settings > Social Image > Upload. If you need to add other OG tags and customize the default settings, go to Page Settings > Advanced > Page Header Code Injection. Read the following section on adding the tags manually and copy-paste the code there.
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.
I'm guessing you figured this out already, but others may have the same problem.
You can't change the Open Graph meta tags with JavaScript after the pageload, as Facebook requests the page from the server again when looking for the meta tags, and so it will not find the updated tags.
Furthermore, I found that Facebook only searches the header for the Open Graph meta tags, so adding them in the body will not work either.
Facebook scrapes pages for meta-data only when it is necessary. After you make changes to the metadata, you need to resubmit the object with the 'scrape' parameter set to 'true' in your POST request.
This is outlined in the Open Graph documentation for updating objects.
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