Disable Jetpack Carousel Comments AJAX calls (4 posts)

  1. corvar
    Posted 3 years ago #

    We don't particularly want comments on our media, and we certainly don't want the additional system load that the comment portion of the Jetpack Carousel can cause.

    I don't currently see any good way to disable comments in Carousel. I have seen posts on how to disable the ability to comment ( http://www.wpbeginner.com/wp-tutorials/how-to-disable-comments-on-wordpress-media-attachments/ ), though this didn't seem to do much for me. And definitely each image load in the Carousel still resulted in an AJAX call to determine the existing comments.

    I also saw people suggest using your style sheet to hide the comments, but this still results in the ajax calls.

    I realize these calls shouldn't be that dire, but when a page with a carousel gets a large amount of traffic, it can just crush our server.

  2. lydiamunoz
    Posted 3 years ago #

    Hello! You can disable the comments editing your funtions.php:

    function filter_deshabilitar_comentarios($open, $idpost) {
        $post_actual = get_post($idpost);
        $salida = false;
        if( $post_actual->post_type != 'attachment' ) $salida = $open;
        return $salida;
    add_filter( 'comments_open', 'filter_deshabilitar_comentarios', 10 , 2 );


  3. corvar
    Posted 3 years ago #

    I used that method, and the AJAX calls still happen. I want to prevent the AJAX calls. In the end, I edited the plugin file modules/carousel/jetpack-carousel.js to disable the getComments function.

  4. corvar
    Posted 3 years ago #

    I give slightly more info on how to work around this issue at my blog, here.

Topic Closed

This topic has been closed to new replies.

About this Topic