Facebook Open Graph warning on multiple fb:admins

2019-03-18 02:28发布

问题:

I'm getting a Facebook Open Graph debugger warning when I put two admins in the fb:admins meta value. With a single admin, it passes fine, but with two I get a warning. Everything works fine, but my OCD wants to get it right. Any help?

Here's my code:

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">

    <meta property="fb:app_id" content="122146944552301"/>
    <meta property="fb:admins" content="15901643,15932442"/>
    <meta property="og:type" content="article" />
    <meta property="og:url" content="http://uamedia.missouri.edu/mizmag/facebook-test.html" />
    <meta property="og:site_name" content="UA Media" />
    <meta property="og:title" content="Facebook Test" />

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <title>Facebook Test</title>
</head>

And I get this error:

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 properties that were not seen in the parsed result: 'fb:admins'

Any ideas?

回答1:

you have to use the array format [http://ogp.me/#array]

In your example:

instead of

<meta property="fb:admins" content="15901643,15932442"/>

you have to use

<meta property="fb:admins" content="15901643"/>
<meta property="fb:admins" content="15932442"/>


回答2:

I've updated Facebook's documentation to include the right directions for more than one admin. Sorry for the confusion.



回答3:

in my oppinion, only the last meta tag will count for the code that uses the property value.

although meta should go in the head, you can use them anywhere and anytime on the page. just keep in mind the parser goes through the code and compiles all the lines in order.

you can even use the [IF] to select the code to be parsed according to certain global conditions.