WordPress.org

Ready to get started?Download WordPress

Forums

Disable Jetpack Carousel Comments AJAX calls (4 posts)

  1. corvar
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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 );

    http://www.aquihaydominios.com/blog/como-desactivar-los-comentarios-en-las-imagenes-de-la-galeria-carousel-de-jetpack/

  3. corvar
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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