Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7308309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:32:24+00:00 2026-05-28T23:32:24+00:00

I’m new to Facebook development and would like to to add a comments plugin

  • 0

I’m new to Facebook development and would like to to add a comments plugin to my site.
I have created an app on Facebook in case it is needed. but since I have not registered my domain yet, I left the App Domain section empty.
Then I copied the code given to me at: http://developers.facebook.com/docs/reference/plugins/comments/ to test the plugin. But when I tested the code in an html file, nothing shows up.

  • Do I need an appid to use the comments plugin?
  • If I need the appid, should I first buy a domain and add it in the App Domain section? can I just test the plugin with example.com url?
  • In general, what is the most basic way to get comments plugin to work?

UPDATE:
Based on Lix’s answer, I have edited my hosts file and added:

127.0.0.1 www.example.com
127.0.0.1 example.com
127.0.0.1 http://www.example.com
127.0.0.1 http://example.com

Here’s my test page:

<html>
<head>
  <title>My Web page</title>
</head>
<body>
    <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 = "//connect.facebook.net/en_US/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470"></div>
</html>  

But still no luck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T23:32:24+00:00Added an answer on May 28, 2026 at 11:32 pm

    So far as I know, you do need an App to use the Comments plugin (for the moderation functionality I believe). If you look at the code Facebook generates for the Comments Box, you can see it has an App Id:

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

    To get your app working correctly locally though, you will need to set up a virtual host. I usually set them up with names like http://website1.dev.

    Part of setting up a virtual host, as Lix mentions, is adding the domain to your hosts file to resolve to your localhost (127.0.0.1).

    Another part of that is creating a Virtual Host on your local web server for your website. This way you are actually accessing your local site in the browser as http://example.com and not localhost/example.com. There are lots of good articles about how to set up Apache to do this, here are two:

    • http://www.dangrossman.info/2007/08/25/multiple-local-websites-with-apache-in-windows/
    • http://mezzoblue.com/archives/2004/08/05/virtual_host/

    Then, make sure that your Facebook app’s admin settings are set up correctly to allow the http://example.com domain. When you set up the Apps “Website” you have to specify the “Site URL”. You can also add your new local domain as the apps “App Domain”.

    God luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to count the length of a string with PHP. The string
I have a French site that I want to parse, but am running into
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.