Facebook Object Debugger: property 'og:url' could not be parsed as type 'url'

StackOverflow https://stackoverflow.com/questions/9038025

  •  03-12-2019
  •  | 
  •  

Question

When I run my Facebook Open Graph object (http://www.21dads.com/testobject) through the Object Debugger, I'm getting the following errors:

Object Invalid Value: Object at URL 'http://www.21dads.com/testobject' of type 'thetestasdf:recipie' is invalid because the given value 'www.21dads.com/testobject' for property 'og:url' could not be parsed as type 'url'.

Missing Required Property: The og:url property is required, but not present.

Missing Required Property: The og:type property is required, but not present.

Missing Required Property: The og:title property is required, but not present.

Here is the HTML on the object page:

<html xmlns="http://www.w3.org/1999/xhtml">

    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# thetestasdf: http://ogp.me/ns/fb/thetestasdf#">
      <meta property="fb:app_id"      content="325291980834949" />
      <meta property="og:type"        content="thetestasdf:recipie" />
      <meta property="og:url"         content="www.21dads.com/testobject" />
      <meta property="og:title"       content="Cookie Recipie!" />
      <meta property="og:description" content="Tastiest recipe ever" />
      <meta property="og:image"       content="http://cdn.techpatio.com/wp-content/uploads/2009/11/cookie_law_eu.gif" />
      <title> Cookie Recipie</title>
    <head/>

    <body>
        <p> Test object page </p>
    </body>

</html>

The URL "www.21dads.com/testobject" is my controller which then generates the HTML from a view file. Why can't this URL be parsed?

Why am I getting the other "missing required property" errors when they are already included?

Thanks.

Était-ce utile?

La solution

You should have scheme in front of og:url content (like http:// or https:// ), or this isn't URL.

In your specific case you should replace www.21dads.com/testobject with http://www.21dads.com/testobject

Autres conseils

You can try to use this https://developers.facebook.com/tools/debug/og/object/ for see what is exactly scrapped. Anyway facebook say they are using open graph, but a lot of personnals test seems to say they don't.

Roundup / checklist of possible issues to check for:

  • Make sure your meta tag matches http:// or https:// in the URL.
  • Make sure your meta tag matches www or non-www in the URL.
  • (Sidenote: You should pick one combo of http/https www/non-www and redirect all of your traffic to that URL anyways, and make sure that matches your og:url meta tag)
  • Check for whitespace before or after the URL
  • Check for a trailing slash forced by Facebook that may not be in your meta tag
  • Check for duplicated "og:url" meta tags
  • Check that your URL is publicly available (you can't use the online debugger successfully for a localhost install - check it once you're on a staging or production site that's publicly available). Double check that you're not on a password-protected or IP address restricted environment.
  • Check your spelling - is the URL really correct?
  • Scrape the URL again. If you fixed it, you need to re-scrape, not just try again.

Another possible reason for this could be duplicated Open Graph Meta tags.

Be careful while using hyperlink through the comment plugin. < div class=" fb - comm en ts" data - href ="http://website.com/view.php?id=323" data-width="100%" data-numposts="20">

I was using https:// instead of http:// (because I didn't have the SSL installed on the server.)

I had the same problem. The description below my posts when shared to FB, showed a lot of strange words such as but only for some of my posts (some were correct). I did below steps and fixed my problem (I don't know any coding):

1- In my wp-admin, I checked the 'TEXT' rather than 'VISUAL' where I could strangely see my description as well as all those rubbish words such as so I got rid of any extra word and saved.

2- In https://developers.facebook.com/tools/debug/og/object/, I typed the post page URL and pushed "Fetch New Scrape Information"

And ta..rrraaa! It was fixed!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top