WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove comment-reply.js completely (6 posts)

  1. MultiformeIngegno
    Member
    Posted 2 years ago #

    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

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

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

    if ( is_singular() && get_option( 'thread_comments' ) )
    wp_enqueue_script( 'comment-reply' );
  4. MultiformeIngegno
    Member
    Posted 2 years ago #

    Thanks for the prompt reply! :)

  5. Bob33
    Member
    Posted 2 years ago #

    Good info.

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

  6. Bob33
    Member
    Posted 2 years ago #

    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');

Topic Closed

This topic has been closed to new replies.

About this Topic