I added open graph meta data to all the posts on a site, however, when I attempt to paste a post link on Facebook, the graph meta information isn't loaded.

Then, when I insert the URL into the debugger / linter, it works, both within the debugger and when posting normally on Facebook (which didn't work moments prior).

This issue seems to have been addressed in the past, in this Stack Overflow question. However that question pertains to a Rails environment.

In that question, the application couldn't handle multiple http requests at the same time. The issue was solved by handling all Facebook API requests in the background using something called delayed_response.

What's the simplest fashion in which I could accomplish this or something similar in a PHP environment running Wordpress and thereby (hopefully) solve my problem?

**I didn't include a sample link in this post because as soon as a user runs it through the debugger, it'll appear to work.*

Edit- Sample of meta tags from a post page:

<meta property="og:title" content="Budget proposal good news for Ontario drivers - AdvocateDaily.com" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://build.advocatedaily.com/wp-content/uploads/2013/04/Stacey-Stevens_Colour_NEW_2012-e1354206636925-150x150.jpg" />
<meta property="og:url" content="http://advocatedaily.com/2013/05/budget-proposal-good-news-for-ontario-drivers/" />
<meta property="og:description" content="A provincial budget proposal to reduce auto insurance premiums by an average of 15 per cent is good news for Ontario drivers, but should not come at the cost of benefits available under the policy, says Toronto personal injury lawyer Stacey L. Stevens. &#8220;In response to this announcement, the Insurance Bureau of Canada (IBC) predicts the [...]" />
<meta property="og:site_name" content="Advocate Daily" />

The PHP being inserted into wp_head:

add_action('wp_head', 'add_fb_open_graph_tags');
function add_fb_open_graph_tags() {
    if (is_single()) {
        global $post;
        if(get_the_post_thumbnail($post->ID, 'thumbnail')) {
            $thumbnail_id = get_post_thumbnail_id($post->ID);
            $thumbnail_object = get_post($thumbnail_id);
            $image = $thumbnail_object->guid;
        } else {
            $image = get_template_directory_uri()."/images/advocatedaily-avatar.png";
        //$description = get_bloginfo('description');
        $description = og_excerpt( $post->post_content, $post->post_excerpt );
        $description = strip_tags($description);
        $description = str_replace("\"", "'", $description);
<meta property="og:title" content="<?php the_title(); ?> - AdvocateDaily.com" />
<meta property="og:type" content="website" />
<meta property="og:image" content="<?php echo $image; ?>" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:description" content="<?php echo $description ?>" />
<meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?>" />
<?php   }
function og_excerpt($text, $excerpt){
    if ($excerpt) return $excerpt;
    $text = strip_shortcodes( $text );
    $text = apply_filters('the_content', $text);
    $text = str_replace(']]>', ']]>', $text);
    $text = strip_tags($text);
    $excerpt_length = apply_filters('excerpt_length', 55);
    $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    $words = preg_split("/[\n
     ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
    if ( count($words) > $excerpt_length ) {
            $text = implode(' ', $words);
            $text = $text . $excerpt_more;
    } else {
            $text = implode(' ', $words);
    return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
  • How had you added it and what precisely you are doing to proactively notify Facebok about it?
    – Rarst
    Commented May 12, 2013 at 13:38
  • I have a function that writes to my header if is_post(). I'll edit my post and add a sample snippet of the metadata.
    – Orun
    Commented May 12, 2013 at 14:52

2 Answers 2


First, this isn't a WordPress specific question, it's a Facebook question.

Secondly, Facebook caches pages, they don't crawl them on every submission. If you have a URL that has already been submitted to Facebook before, then they will have already crawled it for the OG data once before, and saved it to their cache. If you later change the OG data, they won't notice it immediately, because they're pulling from their cache, not from the page.

The Facebook Debugger forces their crawler to pull from the page in real-time, and thus updates their cache.

Simple as that really. If the URL has ever been posted to Facebook before, then changing the OG data on it won't take immediate effect. It'll take a few weeks before FB notices. Using the debugger overrides that.

  • 1
    Thanks, I'll wait it out. I posted this question in Wordpress because I was wondering if there was a best way to handle Facebook API requests in the background in a Wordpress environment, that being said, your point is totally fair and your answer makes sense. Thanks.
    – Orun
    Commented May 13, 2013 at 2:45

I had the same problem. What you need to is to tell Facebook to scrape your content again.

Head over to this link: https://developers.facebook.com/tools/debug/sharing/ and plug your URL in. After the debugger comes back, you should see a button that says "scrape again". Click it.

After I did that, the information appeared as normal on Facebook.

I'm sure there's a more direct way to tell Facebook to scrape your content anew but this works, too.

  • Nice! This option actually wasn't there in the original Facebook URL linter, at the time of my posting this question. Good to know it's there now.
    – Orun
    Commented Jun 25, 2017 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.