Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
    • Dialogs
    • FQL
    • Internationalization
    • Ads API
    • Credits
    • Chat API
    • Legacy REST API
    • Legacy FBML
    • Legacy FBJS
    • Legacy Javascript SDK
  • SDK Reference
  • Tools
  • Tools
    • fb:board
    • fb:bookmark
    • fb:chat-invite
    • fb:comments
    • fb:default
    • fb:else
    • fb:feed
    • fb:friend-selector
    • fb:google-analytics
    • fb:if
    • fb:if-multiple-actors
    • fb:multi-friend-input
    • fb:quantcast
    • fb:random
    • fb:random-option
    • fb:switch
    • fb:typeahead-input
    • fb:typeahead-option
    • fb:user-agent
  • User/Groups
    • fb:eventlink
    • fb:grouplink
    • fb:if-can-see
    • fb:if-can-see-photo
    • fb:if-is-app-user
    • fb:if-is-friends-with-viewer
    • fb:if-is-group-member
    • fb:if-is-user
    • fb:if-is-verified
    • fb:name
    • fb:profile-pic
    • fb:pronoun
    • fb:user
    • fb:user-status
  • Notifications and Requests
    • fb:application-name
    • fb:multi-friend-selector
    • fb:multi-friend-selector_(condensed)
    • fb:req-choice
    • fb:request-form
    • fb:request-form-submit
  • Platform Internationalization
    • fb:date
    • fb:fbml-attribute
    • fb:intl
    • fb:intl-token
    • fb:tag
    • fb:tag-attribute
    • fb:tag-body
    • fb:window-title
  • Deprecated
    • fb:if-is-own-profile
    • fb:if-user-has-added-app
    • fb:networklink
    • fb:notif-email
    • fb:notif-page
    • fb:notif-subject
    • fb:profile-action
    • fb:rock-the-vote
    • fb:userlink
    • fb:visible-to-added-app-users
    • fb:visible-to-user
  • Status Messages
    • fb:error
    • fb:explanation
    • fb:message
    • fb:success
  • Page Navigation
    • fb:create-button
    • fb:dashboard
    • fb:header
    • fb:header-title
    • fb:help
    • fb:mediaheader
    • fb:owner-action
    • fb:tab-item
    • fb:tabs
  • Wall
    • fb:wall
    • fb:wallpost
    • fb:wallpost-action
  • Visibility on Profile
    • fb:18-plus
    • fb:21-plus
    • fb:restricted-to
    • fb:visible-to-app-users
    • fb:visible-to-connection
    • fb:visible-to-friends
    • fb:visible-to-owner
  • Profile-specific
    • fb:action
    • fb:add-section-button
    • fb:if-section-not-added
    • fb:narrow
    • fb:publisher-link
    • fb:subtitle
    • fb:user-item
    • fb:user-table
    • fb:wide
  • Misc
    • fb:add-profile-tab
    • fb:fbml
    • fb:fbmlversion
    • fb:js-string
    • fb:page-admin-edit-header
    • fb:redirect
    • fb:ref
    • fb:serverFbml
    • fb:time
    • fb:title
  • Editor Display
    • fb:editor
    • fb:editor-button
    • fb:editor-buttonset
    • fb:editor-cancel
    • fb:editor-custom
    • fb:editor-date
    • fb:editor-divider
    • fb:editor-month
    • fb:editor-text
    • fb:editor-textarea
    • fb:editor-time
  • Embedded Media
    • fb:flv
    • fb:iframe
    • fb:mp3
    • fb:photo
    • fb:silverlight
    • fb:swf
  • Dialog
    • fb:dialog
    • fb:dialog-button
    • fb:dialog-content
    • fb:dialog-title
  • Additional Permissions
    • fb:prompt-permission
  • Social Plugins
    • fb:comments
    • fb:live-stream
  • Message Attachments
    • fb:attachment-preview
  • Forms
    • fb:captcha
    • fb:submit
  • Reference
    • JavaScript SDK

fb:comments

Advanced Topics › Legacy FBML › fb:comments
FBML has been deprecated. Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed. If you are building a new application on Facebook.com, please implement your application using HTML, JavaScript and CSS. You can use our JavaScript SDK and Social Plugins to embedded many of the same social features available in FBML.

Displays a Comments Box on a Facebook Connect site or in an IFrame application. The Comments Box is the XFBML version of the fb:comments tag. It lets developers add a comment box to a website or in an iframe application easily.

The Comments Box has a default appearance with a rounded box around each post, or you can use the simple attribute to remove the box. If you want, you can choose to specify your own stylesheet (by including the css attribute and reference the URL to your stylesheet).

You can modify the Comments Box's colors and fonts, but you cannot delete, obscure or modify:

  • The Facebook favicon
  • The links to the logged in user and logout
  • The user's profile picture
  • The checkbox to let the user agree to publish the comment on their profile
  • The Post button

If you want to moderate comments before they get posted, set numposts to 0. This hides all comments. You can then use comments.get to retrieve all your comments and moderate or filter them as needed.

Parameters

NameTypeDescription
xidstring

The unique identifier for this set of comments. XIDs can contain alphanumeric characters (Aa-Zz, 0-9), hyphens (-), percent (%), period (.), and underscores (_) (in effect, the result of any urlencode can be a valid XID). Facebook recommends you specify an xid; otherwise any extra GET params that are added after the URL, before the hash, will be made into the XID and the Comments Box will "swap" whenever parameters are appended/changed. Default value is URL-encoded URL of the page without the hash

numpostsint

The maximum number of posts to display. You can set numposts to 0 to not display any comments. Default value is 10

widthstring

The width of the Comments Box in pixels. Default value is 550px

cssstring

The URL to your own stylesheet.
Note: To provide you with better performance, we cache your stylesheet. If you update your stylesheet, you should use a cachebreaker in the URL to the stylesheet, typically by appending a version number to the .CSS file extension, as in ''http://www.example.com/my.css?2''.

titlestring

This is the title of the Feed story that gets published when a comment is made. Default value is the title of the Web page containing the Comments Box

urlstring

The URL that will be listed in feed stories about users' comments. This is typically the URL to the page where the comment was made. Default value is window.document.location.href

simplebool

When true, a rounded box does not appear around each post on your site. Default value is false

reversebool

When true, reverses order of comments so the most recent one appears at the bottom of the list and the composer appears at the bottom of the page. Default value is false

publish_feedbool

Indicates whether the Post comment to my Facebook profile check box is checked. If false, the user must check the check box before the comment can be published to a user's Feed. The comment must be at least 5 words in length in order to be published to Feed.
Policy Note: For IFrame applications, you must set this parameter to false.

Examples

<fb:comments numposts="4" title="My Blog Comments" css="http://www.yourwebsite.com/css/comments.css?1234" simple="1"></fb:comments>
Updated about 4 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy