Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Share doesn't pick up title / description meta tags that are changed after page load

Apparently Facebook Share doesn't pick up the title / description meta tags that are changed (via JavaScript) after the page load. It basically use the meta tags that are available upon load.

This is a simple example.

  • The link will change the title / description meta tags upon click. You can confirm that using Firebug.
  • Click the f|Share button: Facebook still always shows "A title that is available upon page load." and "A description that is available upon page load."

Anybody knows how to fix this?


2 Answers

This is a quote from Facebook. They scrape the page's meta tags when someone shares that page, and every 24 hours onwards (and not on page-load as you suggested). If you change the meta tags, you need to get FB to "lint" your page again using the URL Linter.

When does Facebook scrape my page?

Facebook needs to scrape your page to know how to display it around the site. Facebook scrapes your page every 24 hours to ensure the properties are up to date. The page is also scraped when an admin for the Open Graph page clicks the Like button and when the URL is entered into the Facebook URL Linter. Facebook observes cache headers on your URLs - it will look at "Expires" and "Cache-Control" in order of preference. However, even if you specify a longer time, Facebook will scrape your page every 24 hours.

Source

like image 163
idophir Avatar answered Nov 26 '25 05:11

idophir


Because the facebook server hits the URL you submit and looks for meta tags. It will always default to the original tags.

like image 28
Evilnode Avatar answered Nov 26 '25 05:11

Evilnode



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!