Why this post?
A few months ago, Facebook stopped allowing updating the sharing cache for a URL programmatically, which caused this particular functionality of our “Facebook Open Graph, Google+ and Twitter Card Tags” plugin to stop working.
If you’re not using our plugin, you should just get it, otherwise the information on this post is not for you. Have a nice day 🙂
Each time you update a post on your WordPress website, our plugin makes a call to a specific Graph API URL telling Facebook that the post was updated and that they should scrap it again, in order to get the updated details of that post, thus providing a correct preview when that content is shared on Facebook.
But because Facebook made some changes on their side (go figure…), you are probably getting an error each time you update a post on your website.
(You can still click on the “Manually update Facebook cache” and be done with it)
We found a solution
Basically, Facebook no longer allows updating the cache anonymously, so you have to use an App ID and Secret to do it.
On version 220.127.116.11 we’ve created a filter (fb_og_update_cache_url) that allow advanced users to authenticate the call with an App ID and App Secret of their own, thus bringing this functionality back to life.
After some weeks of testing, we can confirm that this method works, and we decided to add settings to our plugin, on version 2.1.6, that allows setting your own App ID and Secret to authenticate the calls, instead of having to use the filter.
If you are currently using the filter, these settings will NOT be used. You should stop using the filter and use the settings instead.
We decided to write this blog post explaining how to create your own Facebook App, and how to use the app details in our plugin.
Please be advised that no further support will be provided on this. All you need to know is in this blog post.
If you are not comfortable following the steps, please do not do it, and just manually update the cache of your URLs on the Facebook Sharing Debugger.
Step 1: Create your own Facebook App
If you already have a Facebook App, you can skip this step. Any App will do. You don’t have to create a specific app for this. Just skip this step and use your existing App ID and Secret on step 2.
Go to https://developers.facebook.com/apps/ click on “+ Add a New App”, fill a name of your choice and your email, click on “Create App ID”.
If you manage multiple WordPress websites, you do NOT need to create a new App for each website. Just use the same App ID and Secret on all of them.
Step 2: Get the App details
Go to your App Dashboard and copy both the App ID and the App Secret. You’ll have to click on “Show” to get the App Secret.
Step 3: Configure the plugin
Go to our plugin settings page on “Settings” -> “Facebook Open Graph, Google+ and Twitter Card Tags” -> “Open Graph” tab -> “Facebook Open Graph Tags cache” panel, activate the “Clear cache” option and fill in your App details.
And that’s it. Your website should now be able to clear the Facebook sharing cache each time you update a post.
It’s possible that you still get an error when you create a new post, because the plugin will be trying to flush the cache on something that has never been shared to Facebook, but if you update it again, it will work just fine.
Step 4: Drink a beer…
… or any other drink of your choice.
If you want us to join you on that beer, go to the plugin settings page and click on that nice PayPal “Donate” button on the bottom right of the screen.
Also, do not forget to give us a 5 stars rating on WordPress.org 🙂