Search code examples
facebookpluginsfacebook-commentssocial-media

Comments using Facebook Comment Plugin disappear after refresh


I used the code generated on this page:

https://developers.facebook.com/docs/reference/plugins/comments/

However, since my pages are dynamic I replaced this part:

<div class="fb-comments" data-href="http://example.com" data-width="470" data-num-posts="10"></div>

with...

<div class="fb-comments" data-href="http://www.mywebsite.com/index.php?a=[some dynamic name]" data-width="470" data-num-posts="10"></div>

When I try to post, the comment would show up but when I refresh the page, it would disappear. Am I doing something wrong?


Solution

  • Yes, your url has get parameters.

    The facebook like button, the comments box, etc, they don't use the get parameters so for you having this:

    http://www.mywebsite.com/index.php?a=[some dynamic name]
    

    or this:

    http://www.mywebsite.com/index.php
    

    Its all the same