4

I have a website with alcohol content which I have registered as a Facebook application. When I set the application restrictions using the graph API (https://graph.facebook.com/APP_ID?restrictions={"age_distribution":"21+"} or {"type":"alcohol"}) the application link on Facebook is hidden from underage accounts, which is great.

The problem is, when an above age person likes or shares a page on the website, underage friends of theirs can see the like on the above age person's profile wall. Is there a way to hide "like" and "share" posts on a user's wall from the view of underage accounts? I've seen this done with other websites, but have been unable to replicate it myself.

Here are the meta tags & javascript calls I'm using on the website:

<meta property="og:title" content="FB Restrictions"/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="FB Restrictions Site"/>
<meta property="og:description" content="Testing Facebook Age Restrictions"/>   
<meta property="fb:app_id" content="MyAppID"/>

<script>

window.fbAsyncInit = function() {
FB.init({appId: 'MyAppID', status: true, cookie: true,xfbml: true});
};

(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 = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

</script>

Thanks in advance for your help!

AdmanStrong
  • 323
  • 1
  • 8

1 Answers1

1

According to Facebook's User Restrictions Documentation, you can do so by using the following Open Graph meta tags on the pages you are trying to restrict:

Restriction by Age

<meta property="og:restrictions:age" content="21+"/>

You can also set content based restrictions on alcohol by using:

<meta property="og:restrictions:content" content="alcohol"/>

Additionally, you can also set country restrictions:

<meta property="og:restrictions:country:allowed" content="US" />

<meta property="og:restrictions:country:disallowed" content="CN" />

*Note you can only have one :allowed or one :disallowed instance in the markup.

Axel
  • 10,732
  • 2
  • 30
  • 43