How to successfully update the Facebook sharing cache while using our Facebook Open Graph plugin for WordPress

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.

Facebook error

(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 2.1.4.4 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”.

Add a new Facebook App

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.

Get the App ID and 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.

Fill the details

And that’s it. Your website should now be able to clear the Facebook sharing cache each time you update a post.

Facebook Open Graph Tags updated

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.

Facebook sharing preview

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 🙂

5 comentários a How to successfully update the Facebook sharing cache while using our Facebook Open Graph plugin for WordPress

  1. Luca 2018-01-11 às 11:53 #

    Hi, I tried to get it as you suggested but it seems don’t work fine. I see always the same debug errors on facebook for developers (missing og:description, fb:app_id) even if I added App Id and secret and scraped the post.
    Do you have any suggestions?
    Thanks a lot

  2. Webdados 2018-01-11 às 12:25 #

    Hi there Luca,

    This is not a support forum and the errors you mention (missing og:description …) are not related to this post subject.
    Please use the support forum at wordpress.org

  3. Luca 2018-01-11 às 16:20 #

    Ok, thanks I’m going to do it!

  4. Tom 2018-02-19 às 19:48 #

    I cannot find the filter settings to deactivate the fb_og_update_cache_url?

  5. Webdados 2018-02-19 às 20:09 #

    Hi there Tom,

    Please use the support forum at wordpress.org

Deixe uma resposta

*

_