Jump to content


Photo
* * * * * 1 votes

Wordpress SEO by Yoast OpenGraph Fixes for Facebook

wordpress seo by yoast opengraph fixes facebook fb:page_id error og:locale:locale en_us error

  • Please log in to reply
No replies to this topic

#1 Administrator

Administrator

    Dev Partner

  • Lead Developer
  • 909 posts
  • 563 Thanks
  • Gender:Male
  • Location:New York
  • Interests:Everything code...

Posted 07 May 2012 - 07:32 PM

Wordpress SEO by Yoast OpenGraph Fixes for Facebook

If you are using the Yoast SEO Version 1.1.5 for Wordpress and are configuring your Facebook social admin then you might have noticed the following errors when debugging your homepage at Facebook:

First is the og:locale error:

Open Graph Warnings That Should Be Fixed
Parser Mismatched Metadata:
The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input property =>content pairs that were not seen in the parsed result: 'og:locale:locale => en_US'


opengraphUS.PNG


The issue is US should not be in caps, should be en_us

Fix:
Open
/wp-content/plugins/wordpress-seo/frontend/class-opengraph.php

Find:
echo "<meta property='og:locale' content='".esc_attr( get_locale() )."'/>\n";


Change to:
echo "<meta property='og:locale' content='en_us'/>\n";


Now save settings in Yoast WordPress SEO: Social

Try the Facebook debug and the error should be gone.

Next is the fb:page_id error

Extraneous Property: Objects of this type do not allow properties named fb:page_id.

This is also an easy fix. The problem, well not really a problem, is this is no longer used by Facebook. Its deprecated now so it will return an error when debugging.

On April 1st, 2012 Facebook will be depreciating claiming websites for Facebook Domain Insights using the fb:page_id tag. So you will need to remove this eventually anyway.

https://developers.f...ok.com/roadmap/

To claim a page for Insights it’s recommended to use the fb:admins or fb:app_id tags instead:

https://developers.f.../docs/insights/


Fix:
Open
/wp-content/plugins/wordpress-seo/frontend/class-opengraph.php

Find:


} else if ( isset( $this->options['fbadminpage'] ) && 0 != $this->options['fbadminpage'] ) {
echo "<meta property='fb:page_id' content='".esc_attr( $this->options['fbadminpage'] )."'/>\n";


And simply remove it. Debug and the error is gone.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users