Support » Plugin: WP Facebook Open Graph protocol » [Plugin: WP Facebook Open Graph protocol] Problem with trailing slash in home page url

  • Resolved mazaisti


    We have a website where we use wpfbogp and we have had some problems with og:url -tag.

    Facebook debugger complains that “… property values for a given property being mismatched. Here are the input property =>content pairs that were not seen in the parsed result: ‘og:url => [our site url WITH trailing slash]”

    At website the meta og:url tag is WITHOUT the trailing slash on home page.

    The problem is that Facebook always adds the trailing slash in to url and WordPress always strips it off when stored in the general settings and that causes mismatch in Facebook url comparison.

    I solved the problem by modifying wpfbogp code like this (line 112):

    before: $wpfbogp_url = get_bloginfo( ‘url’ );
    after: $wpfbogp_url = get_bloginfo( ‘url’ ) . ‘/’;

    I don’t know if this breaks anything now or in the future because it concerns only the homepage and Facebook seems to add the trailing slash in the url field regardless if it is in the url field in Facebook application settings. It is always possible that FB will stop modifying the url field content in the future.

    Your competitor has found out the same problem and decided to make tariling slash optional 🙂 See version 0.1.9 in

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Andrew Ryno


    In the next version I’ll tralingslashit() the blog URL so this doesn’t come up. Didn’t think that Facebook would be that strict (and I didn’t run into this problem in testing).

    I’ve just seen this error on lint. It definitely wasn’t there when I introduced OGP to my site a few months ago.

    To satisfy lint I’ve had to set my homepage to use:
    <meta property="og:url" content="<? echo site_url(); ?>/"/> (with extra slash)

    and when on a post page, I’ve used:
    <meta property="og:url" content="<? echo the_permalink(); ?>"/>

    That seems to work…for now

    Plugin Author Chuck Reynolds


    afaik this is handled in past updates. closing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Facebook Open Graph protocol] Problem with trailing slash in home page url’ is closed to new replies.