Comments Plugin

The comments plugin lets people comment on content on your site using their Facebook account. People can choose to share their comment activity with their friends (and friends of their friends) on Facebook as well. The comments plugin also includes built-in moderation tools and social relevance ranking.

Comments Plugin ConfiguratorModerationSettingsAdjust LanguageFAQs


1. Choose URL or Page

Choose the URL of a website you want to use with the comments plugin.

2. Code Configurator

Copy and paste the URL into the code configurator below. You can adjust settings like the width of your comments plugin or how many posts you want to show by default (num_posts). Click the Get Code button to generate your comments plugin code.

3. Copy and Paste code snippet

Copy and paste the code snippet into the HTML of the website or webpage where you want to implement comments.

Comments Plugin Code Generator

URL to comment on
Number of Posts


The code configurator above only uses a subset of all possible settings for your comments plugin. You can also change the following settings:

Setting HTML5 Attribute Description Default Value



The color scheme used by the comments plugin. Can be "light" or "dark".




The absolute URL that comments posted in the plugin will be permanently associated with. All stories shared on Facebook about comments posted using the comments plugin will link to this URL.

Current URL.



A boolean value that specifies whether to show the mobile-optimized version or not.




The number of comments to show by default. The minimum value is 1.




The order to use when displaying comments. Can be "social", "reverse_time", or "time". The different order types are explained in the FAQ




The width of the comments plugin on the webpage. This can be either a pixel value or a percentage (such as 100%) for fluid width. The mobile version of the comments plugin ignores the width parameter and instead has a fluid width of 100%. The minimum width supported by the comments plugin is 320px.


Comments Sorting

People can sort comments by time or social ranking using the menu on the top right of the comments plugin.

You can define the default ordering using the data-order-by attribute and one of these three values:

social (default)

This is also known as "Top". The comments plugin uses social signals to surface the highest quality comments. Comments are ordered so that the most relevant comments from friends and friends of friends are shown first, as well as the most-liked or active discussion threads. Comments marked as spam are hidden from view.

Note: Older comment threads—including those associated with an Open Graph object created before the original release of the comments plugin—will not be able to be sorted by social.


Comments are shown in the order that they were posted, with the oldest comments at the top and the newest at the bottom.


Comments are shown in the opposite order that they were posted, with the newest comments at the top and the oldest at the bottom.

Adjust Language

You can adjust the language of the Comments plugin by loading a localized version of the Facebook SDK for JavaScript. When you load the SDK, adjust the value js.src to use your locale. For example, you can replace en_US with your locale, such as fr_FR for French (France):

js.src = "//";

Supported locales are referenced in the Facebook Locales XML file.

You may need to adjust the width of a social plugin to accommodate different languages. Learn more about localization and translation.

Comments Moderation

A part of the comments plugin is a powerful moderation tool. This tool makes it easy and fast for your community management team to moderate multiple comments at once.


To use the comments moderation tool ,you need to complete the moderation setup instructions.

Moderation Setup Instructions


There are 2 ways to navigate to the moderation tool:

1. App-based moderation view: Go to You will get a list of all your Facebook apps, which lets you moderate all comments associated with each app. If you don't use a Facebook app with your comments plugin, you won't be able to use this view.

2. Page-based moderation view: Click the Moderation Tool link next to the comments box (see screenshot below). The view only shows comments posted to this webpage (URL).

Moderation View

We show both moderation views in the screenshots below. If you're using the app-based moderation view, you can use the menu to switch between apps.

In the moderation table, you can either approve or hide comments depending on their status. To change the status of multiple comments, use the checkboxes in the left column.

1. Page-based Moderation View

In this moderation view, all comments for a specific url will be displayed.

2. App-based Moderation View

In this moderation view, all comments for your application will be displayed.

3. Flagged Queue

Comments that have been flagged by users or Facebook will be displayed here. Comments in this list may be public or hidden depending on applications settings and how the comment was reported.

4. My Queue

To better split up work between developers, you can use the this feature to assign comments to yourself for moderation. Comments assigned here will still be available to other moderators or admins, but comments in your queue won't appear in others' queues.


For each app, you can define custom settings. Use the Settings button (on the top right of the tool) to open the settings dialog.


You can promote other people to become the moderator of your comments. Start typing a friend's name into the input box and a typeahead will help you select the person you want to make a moderator.

Blacklisted Words

Moderators can add words to a blacklist. Posts containing any of the blacklisted words will be automatically placed in the Review tab. All comments are checked via substring matching. For example, if you blacklist the word at, all comments that contain the sequence a t anywhere will be marked with limited visibility—if comments contain the words bat, hat, attend, and so on, they'll be placed int he Review tab.

Sort Comments By

You can also control how comments are sorted. Learn more in Comments Sorting.


You can change the default visibility for new comments. For example, you might want to approve all new comments. If a comment isn't approved, the comment will only be visible to the commenter until a moderator approves the comment.

There are three different moderation modes:


All comments will be public. They'll also appear in the Review tab.

Blacklist-only Review

All comments will be public. Only comments containing blacklisted words will appear in the Review tab.


All comments will be hidden. Only comments without blacklisted words will appear the Review tab.

Banned Users

In the tab Banned Users, moderators can search for banned users. If a new comment is published from a banned user, this comment will automatically have limited visibility and show up in the Review tab.

Comment Mirroring

Comment Mirroring allows people to participate in a single conversation, whether comments come from your webpage or from your Facebook Page. When you share a link to your website on your Facebook Page, comments from that webpage will also appear as comments on your Facebook Page post and vice-versa. This creates a richer conversation on both your Facebook Page and on your website because the comments will appear in both places.

You can turn on comment mirroring in the moderation tool by going to the Settings tab. In order to turn on comment mirroring, you need to be a Page admin for the Facebook Page on which you want to enable mirroring. Comment mirroring takes effect on new webpages created after the setting has been enabled. Once comment mirroring is turned on for a particular webpage, there is no way to disable mirroring (you can only turn off mirroring for new webpages going forward), so if the auto close feature is enabled and it is shared to your Facebook Page, new comments can still be made from the Facebook Page post, but not from your webpage.

Will people know that we’re mirroring comments? When a person begins to write a comment on your website, they'll see a message that lets them know that their comment will also appear on your Facebook Page. The same message appears when a person begins to write a comment on an article posted to your Facebook Page.

How does moderation work? All comments, whether left on the Facebook Page post or on the original article on your website, will show up in the main Facebook comment moderation tool, so all comments displayed on the article page can be moderated. If you hide a comment in the moderation tool, it will automatically be hidden on the Facebook Page, too.

URL Settings

Closing A Thread

You can close a comments thread on any URL where you're using the comments plugin. Doing this means that people won't be able to add new comments to the discussion on that webpage. You can close a thread in the URL Settings menu.

Overriding Auto Close

If you've enabled auto close, you can override the a closed thread, which re-opens it for comments. To do this, go to URL Settings and turn on Override Auto Close. Then set the desired closure state for the URL you're moderating.

Moderation Setup

To use the moderation tool, you either need to connect a Facebook account or a Facebook app to your comments plugin implementation.

Setup using a Facebook App (Preferred)

If your site has many comments boxes, we recommend you specify a Facebook app ID as the managing entity, which means that all app administrators can moderate comments. Doing this enables a moderator interface on Facebook where comments from all plugins administered by your app ID can be easily moderated together.

<meta property="fb:app_id" content="{YOUR_APP_ID}" />

In addition to the people you add using the Moderators setting, all admins of your app will also be able to moderate comments.

When you implement multiple comments boxes on your site and connect them to an app by specifying an app ID, the moderation settings you choose will apply to all your comments boxes.

For example, changing the moderation setting to has limited visibility affects all comments boxes under the same app ID. If you need to apply different moderation settings in different areas of your site, you should use two or more app IDs. You can then apply different moderation settings for each group of comments boxes.

You can specify either fb:app_id or fb:admins, but not both.

Assign a Facebook Account as Admin

To assign a Facebook account to be the admin of a comments plugin implementation, include the following meta element in the <head> section of every webpage where you use the comments plugin:

<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>

To add multiple moderators, add more than one element, each with one Facebook ID:

<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID_1}"/>
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID_2}"/>

Comments Counter

Using the fb:comments-count value displays the number of comments on a given URL in a <span> element on your webpage. You can then use CSS to style this <span> element to match the rest of your website. Note: this feature isn't currently available in HTML5.

For example, to show the number of comments on, use this code:

<span class="fb-comments-count" data-href=""></span>
awesome comments 

This will display:

69391 awesome comments

The number of comments on a given URL can be accessed by using the Graph API. For example, the number of comments on is available using the comment_count property on the share field of the URL node:{comment_count}&amp;id=<YOUR_URL>