Facebook Comments Vanished

Hey there!

Something happened and the facebook comments on all our posts disappeared. I did not make any changes that I know would cause this.

Please help.

Login information is in the secure note.

Hey @ynrcon,

Please tell us the recent changes you’ve made to your site before this happened. And, also check or do for the following:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.

  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  4. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

  5. Remove custom CSS, Javascript and templates.

  6. Contact your host to increase your allocated memory or do it yourself by adding this code in your wp-config.php

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Also note that we may deactivate plugins and remove customizations while we are troubleshooting. If those could not be done in your site, please copy your site to a staging server and we’ll investigate there.

Thanks.

The only thing I changed is adding the FB tracking pixel via functions.php

This is the code that I added:

//FB Pixel in header
function third_party_tracking_code_header() { ?>

<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '506622302781068'); // Insert your pixel ID here.
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=506622302781068&ev=PageView&noscript=1"
/></noscript>
<script>

<?php }
add_action( 'wp_head', 'third_party_tracking_code_header' );

After I remove the code, everything works fine…

Hello There,

Please update your code and use this:

//FB Pixel in header
function third_party_tracking_code_header() { ?>

<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '506622302781068'); // Insert your pixel ID here.
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=506622302781068&ev=PageView&noscript=1"
/></noscript>


<?php }
add_action( 'wp_head', 'third_party_tracking_code_header' );

Hope this helps. Kindly let us know.

Oh I see that unclosed tag!
What a simple mistake…
Everything works now. Thanks for your help!

You’re more than welcome, glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.