Search code examples
javascripthtmlcssfacebookfacebook-comments

How to moderate facebook comment


i am trying to moderate facebook's plugin of comments. But his documentation about this is not clear for me. I tried to integrate but it is not working.

Anyone knows how to implement this?

<div id="fb-root"></div>

<script>
    (function(d, s, id) {
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) return;
       js = d.createElement(s);
       js.id = id;
       js.src = 'https://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.11&appId=301163393374987';
       fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

<div class="fb-comments" data-href="https://teste/comments/"
 data-width="100%" data-numposts="5"></div>

Notes:

Any response will be appreciate.


Solution

  • You have to add your meta tag inside the header.

    Something like this:

    <meta property='fb:app_id' content='xxxxxxxxxx' />
    

    Where the content is your app id on facebook app. Probably that's what you need to get it working, other side it doesn't work at all.

    Also, make sure you have these other ones:

    <meta property="og:url" content="URL" />
    <meta property="og:title" content="TITLE" />
    <meta property="og:description" content="DESC" />
    <meta property="og:image" content="IMG" />
    

    To check if it's working you can use the fb debug tool at: https://developers.facebook.com/tools/debug/sharing/?

    Just add your URL to check if it's ok.