Support » Fixing WordPress » How to remove comment-reply.js completely

  • Resolved MultiformeIngegno

    (@lorenzone92)


    Hi! 🙂
    I created a child theme of TwentyEleven for a site of mine. Now I’m trying to optimize it removing all the unnecessary code I find.

    It’s a “static” website and I removed all the interactions with users, so there are no comments sections or anything.. How can I remove the /wp-includes/js/comment-reply.js?ver=20090102 script tag?

    Thanks in advance,
    Lorenzo

Viewing 5 replies - 1 through 5 (of 5 total)
  • By placing an amended header.php file in your child them that lacks the

    if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );

    line.

    copy over header.php from parent to child, and remove/comment out

    if ( is_singular() && get_option( 'thread_comments' ) )
    wp_enqueue_script( 'comment-reply' );

    Thanks for the prompt reply! 🙂

    Good info.

    Is there something that could be placed in functions.php to do the same job?

    OK for y’all that’s interested something like this should work I think

    function clean_header(){
    	wp_deregister_script( 'comment-reply' );
             }
    add_action('init','clean_header');
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove comment-reply.js completely’ is closed to new replies.