WordPress.org

Support

Support » Plugins and Hacks » Yoast SEO » Cannot change og_type

Cannot change og_type

  • WordPress version: 3.5.1
    WordPress SEO version: Latest (not sure where to find it)

    So I attempted to switch over to using WordPress SEO for OpenGraph tags from a different plugin that seems to have issues with WP SEO. But have come up with a couple issues as a result.

    I deactivated the plugin I was using before.

    The first issue is that the og:description is not getting inserted in to any page/post.

    Secondly, the plugin I was using before had the og:type set as article for my homepage. WP SEO wants to set the type as website, but because I was using article as the type previously, Facebook throws a fit. Here is the error that I get from Facebook when I run the debug.

    Cannot change og_type: The object at ‘http://www.guysfromqueens.com/’ previously had type ‘article’ and cannot be changed to an object of type ‘website’ to avoid data corruption of existing actions.

    What would be the best way to fix this?

    http://wordpress.org/extend/plugins/wordpress-seo/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am having the exact same problem in the same situation and would love some help.

    Okay so in the API documentation I found this snippet of code:

    function yoast_change_opengraph_type( $type ) {
      if ( is_page( 'X' ) )
        return 'video';
    }
    add_filter( 'wpseo_opengraph_type', 'yoast_change_opengraph_type', 10, 1 );

    I changed the if statement to:

    if ( is_home() )

    Which worked and fixed my problem. But as a result it’s leaving every other post/page without an og:type…

    Is there any way to fix this without removing the if statement all together? The homepage is the only page that needs the og:type changed.

    What about changing it to:

    if ( is_home() ) {
        return 'video';
    } elseif ( is_single() ) {
        return 'article';
    } else {
        return 'website';
    }

    Have a look at http://codex.wordpress.org/Conditional_Tags and play around with the tags, if you wanna have more types or change them.

    Also having the issue with og:type previously probably being set as article for front page by a different plugin and now WP Seo sets it to website so Facebook debugger complains.

    Did you fix it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot change og_type’ is closed to new replies.
Skip to toolbar