How to remove comment-reply.js from your wordpress site ?


Hello Friends,

I hope you all are doing well!!

If you want to remove “comment-reply.js” file and reduce to number of HTTP request from your wordpress website then don’t worry,  I am going to share my knowledge, so you can do it easily even if you have any technical knowledge or not.

Just add given below code into your function.php file and refresh the page.

// Remove comment-reply.min.js from footer
function remove_comment_reply_js(){
wp_deregister_script( ‘comment-reply’ );
}
add_action(‘init’,’remove_comment_reply_js’);

It will Show only on blog post

// Remove comment-reply.min.js from footer
function remove_comment_reply_js(){

if(is_singular(‘post’)){

// no action

}else{
wp_deregister_script( ‘comment-reply’ );

}
}
add_action(‘init’,’remove_comment_reply_js’);

You can also watch my video for live demo

Enjoy Code

Advertisements

Sr. Software Engineer

Tagged with: , , , ,
Posted in Wordpress

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: