Support » Plugin: W3 Total Cache » W3 Total Cache and Facebook Open Graph Errors

  • Resolved timkainu



    I am trying to get Facebook to share my post correctly by using Open Graph tags in my header.php file.

    By that, what I mean is when someone clicks the “Like” button on my post, I want the featured image, description and title to show up on the persons page who “Liked” it.

    All I get now is a URL with no description or image.

    When I use the debugger at and input the URL to my article – – it gives me a bunch of errors.

    But when I turn off W3 Total Cache, everything works fine.

    Here are the open graph tags in my header.php file:

    <!-- the default values -->
    <meta property="fb:app_id" content="170151483038653" />
    <meta property="fb:admins" content="1570847387" />
    <!-- if page is content page -->
    <?php if (is_single()) { ?>
    <meta property="og:url" content="<?php the_permalink() ?>"/>
    <meta property="og:title" content="<?php single_post_title(''); ?>" />
    <meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />
    <meta property="og:type" content="w" />
    <meta property="og:image" content="<?php if (function_exists('wp_get_attachment_thumb_url')) {echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID)); }?>" />
    <!-- if page is others -->
    <?php } else { ?>
    <meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
    <meta property="og:description" content="<?php bloginfo('description'); ?>" />
    <meta property="og:type" content="website" />
    <meta property="og:image" content="" /> <?php } ?>

    Please let me know if you need any more info and I’d be glad to supply it.


Viewing 8 replies - 1 through 8 (of 8 total)
  • @timkainu
    i have the same problem, you find any solution?!?

    timkainu: I see you solved the problem. Was it Total Cache settings or did you miss some FB code?
    Usual problem (I think) seems to be forgetting put the right stuff in the html opening tag.
    <html xmlns=””

    Well after a week of searching, I found the fix. You have to block W3 Total Cache from serving cached pages to Facebook’s bot/crawler. Make sure to reject these user agents in the “page cache” tab in W3 Total Cache:

    This will block W3 Total Cache from sending cached pages to Facebook. This solved my issue with thumbnails and descriptions.

    Excellent work. Others have had issues as well fun to see you solved it.
    Could you mark this as resolved then?


    Wow, thanks so much! Problem solved.


    I am also facing the same problem. But when I save the settings, I get this error:
    Disk enhanced page caching is not active. To enable it, add the following rules into the server configuration file (/home/technost/public_html/.htaccess) of the site above the WordPress directives. (View code) Or if permission allow this can be done automatically, by clicking here (auto install).

    I gave 777 permission to htaccess and then tried clicking on auto-install, but still the same message everytime.

    I also manually added the code in htaccess, but still the same message.

    Any guess what’s the problem here.

    I am just trying to reject these user agents, just as mentioned by @timkainu

    Plugin Author Frederick Townes


    it’s really hard to guess without hands on checking in that release. Can you please submit a bug submission form from the support tab of the plugin?

    Thanks for the reply. Yes, I will submit that form from support tab.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘W3 Total Cache and Facebook Open Graph Errors’ is closed to new replies.