Title: Comments Missing After SSL Upgrade
Last modified: August 30, 2016

---

# Comments Missing After SSL Upgrade

 *  [silgringo](https://wordpress.org/support/users/silgringo/)
 * (@silgringo)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/)
 * Greetings!
 * I updated [http://www.freewheelings.com](http://www.freewheelings.com) to [https://www.freewheelings.com](https://www.freewheelings.com)
   and all facebook comments are missing.
 * Any idea how I get them back?
 * Thanks,
 * Brandon
 * [https://wordpress.org/plugins/facebook-comments-plugin/](https://wordpress.org/plugins/facebook-comments-plugin/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6887986)
 * Hi,
 * I have the same issue. I went from [http://supersnelgezond.nl](http://supersnelgezond.nl)
   to [https://supersnelgezond.nl](https://supersnelgezond.nl). Is there a way to
   get the “old” Facebook comments back?
 * Thank you,
 * Carlo
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6887990)
 * Hi silgringo,
 * This is what I did in the end.
 * I added the facebook comments without a plugin, like mentioned here: [http://ryanbradley.com/blog/how-to-install-facebook-comments-on-wordpress-site](http://ryanbradley.com/blog/how-to-install-facebook-comments-on-wordpress-site)
 * That does not solve the issue, but now we are ready to fix it.
 * This code places the facebook comments box:
 *     ```
       <div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 * The `<?php the_permalink(); ?>` prints current URL including the https (once 
   you migrated to https).
 * I have replaced that part by echo-ing the http URL and the current slug. That
   fixed it, at least if thought. I had all my all comments back, but when people
   started to comment to new posts it went wrong. I did not see those comments appear
   in my Facebook Moderation Tool. They seemed to be hanging out there in space.
   So I altered the code in such a way that it uses the https URL for new posts.
 *     ```
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 8047) {
           echo "http://supersnelgezond.nl/" . $post->post_name;
       }else{
           the_permalink();
       }
       ?>/" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 * If you implement this option please adjust the post id number. This should match
   the post id of your first new post using https.
 * Also change the http URL to your own URL.
 * You can place the code on the first line of your comments.php file of your theme
   or (even better) create a comments.php in your child theme with the following
   code:
 *     ```
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 8047) {
           echo "http://supersnelgezond.nl/" . $post->post_name;
       }else{
           the_permalink();
       }
       ?>/" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
   
       <?php include '/wp-content/themes/Avada/comments.php'?>
       ```
   
 * Please make sure to update the last line to point to your Parrent Theme comments.
   php
 * PS It works as far as I can tell. If somebody knows of a reason why you should
   not to solve it like this, please let me know. Hopefully you will have the better
   solution as well 😉
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6887994)
 * PS found 2 times a slash to much (once at the end of Facebook comment part and
   one at the include), this is my current working version of the code:
 *     ```
       <br/>
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 8000) {
           echo "http://supersnelgezond.nl/" . $post->post_name;
       }else{
           the_permalink();
       }
       ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
   
       <?php include 'wp-content/themes/Avada/comments.php'?>
       ```
   
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6887995)
 * My apologies, I was missing one slash for the “old” posts
 *     ```
       <br/>
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 8000) {
           echo "http://supersnelgezond.nl/" . $post->post_name . "/";
       }else{
           the_permalink();
       }
       ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 *  Thread Starter [silgringo](https://wordpress.org/support/users/silgringo/)
 * (@silgringo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888000)
 * I will certainly have to give this a try when I got some free time. Says the 
   guy still working at 9:30. Thank you so much for taking the time to post this
   jazzmofo. You’re the best!
 * I’ll let yo know how it turns out.
 *  Thread Starter [silgringo](https://wordpress.org/support/users/silgringo/)
 * (@silgringo)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888007)
 * I don’t know if I got something wrong, but now it just posts new comments to 
   all post and the old comments are still not there. I added this:
 *     ```
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 4006) {
           echo "http://www.freewheelings.com/" .  $post->post_name . "/";
       }else{
           the_permalink();
       }
       ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888008)
 * I double checked and compared the last code I posted to the code I’m using on
   my website right now. It is the same:
 *     ```
       <br/>
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 8000) {
           echo "http://supersnelgezond.nl/" . $post->post_name . "/";
       }else{
           the_permalink();
       }
       ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 * If you do see the new posts, it means that the “else” part of the code is working
   but the
 * `echo "http://supersnelgezond.nl/" . $post->post_name . "/";`
 * Is not writing the `http://supersnelgezond.nl/post-slug/` (where “post-slug” 
   should be the slug of that post you are on.
 * I have honestly no idea why that does not work for you. Sorry, maybe somebody
   else can help?
 *  [immortal](https://wordpress.org/support/users/paksociety/)
 * (@paksociety)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888023)
 * I know this is a old topic but i want to share working solution of it,
    Using
   the approach used by [@jazzmofo](https://wordpress.org/support/users/jazzmofo/)
   i found that why it is not working for others , problem is in this line echo “
   [http://supersnelgezond.nl/&#8221](http://supersnelgezond.nl/&#8221); . $post-
   >post_name . “/”; as this site is using permalink structure of site.com/postname
   so it will only work if any one is using same permalink structure, so i alter
   the code as:-
 *     ```
       <?php
       $permalink = get_permalink();
       $find = array( 'https://' );
       $replace = 'http://';
       $output = str_replace( $find, $replace, $permalink );
       ?>
       <div class="fb-comments" data-href="<?php
       $postid = get_the_ID();
   
       if ($postid < 44133) {
           echo $output;
       }else{
           the_permalink();
       }
   
       ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>
       ```
   
 * No need to add your site link as this code will get permalink , it will replace
   https with http and yahooooooo.
    check it and see the magic 🙂
 * **Note:-** Do change post ID number to yours. it will be id of first post you
   published after changing your site to https.
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888024)
 * Good thinking 🙂 And very nice of you to post the solution so others can benefit!
 *  [immortal](https://wordpress.org/support/users/paksociety/)
 * (@paksociety)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888025)
 * Just trying to save others day 🙂
 *  [Damir](https://wordpress.org/support/users/pevoje/)
 * (@pevoje)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888026)
 * [@immortal](https://wordpress.org/support/users/immortal/) is there a way to 
   know from which post/page ID was the change to https? I did the change 4-5 months
   ago and this started going on recently?
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888027)
 * Maybe it helps to check the date of the SSL certificate and use that to find 
   the related post?
 *  [Damir](https://wordpress.org/support/users/pevoje/)
 * (@pevoje)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888028)
 * yes, good point.
 * Let me elaborate-My situation is the following, client uses fb comments plugin
   only on pages (no posts on website). All the comments disappeared from the website
   already once and now after ssl installation again several months later.
 * I have a problem because hundreds of comments are missing and new ones are again
   started to be posted.
 * Any idea how to solve this or someone willing to help out one on one?
 *  [jazzmofo](https://wordpress.org/support/users/jazzmofo/)
 * (@jazzmofo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888029)
 * Pages have post-dates too and they use the post ID as well. I would find the 
   date of the switch to SSL using the certificate, sort the pages by date in the
   WP dashboard and find the first page posted after that date of the switch. Click
   edit page and you’ll find the post ID in the URL.
 *  [Hello](https://wordpress.org/support/users/themophiles/)
 * (@themophiles)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888030)
 * It’s not working 🙁 I tried
 * Please help.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Comments Missing After SSL Upgrade’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facebook-comments-plugin_577794.svg)
 * [Facebook Comments](https://wordpress.org/plugins/facebook-comments-plugin/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-comments-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-comments-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-comments-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-comments-plugin/reviews/)

 * 15 replies
 * 5 participants
 * Last reply from: [Hello](https://wordpress.org/support/users/themophiles/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/comments-missing-after-ssl-upgrade/#post-6888030)
 * Status: not resolved