How to remove JavaScript to reply to comments in WordPress if you don't need it

Do you have a WordPress site that does not have comments active? Do you use Disqus or another system that replaces the native WordPress commenting system?

Then surely you can completely remove the JavaScript that makes it possible to respond to comments, and thus, with less unnecessary script loading on all your pages, you can accelerate its speed even more.

Specifically, the script is this: /wp-includes/js/comment-reply.min.js

And all you have to do to prevent it from loading is to add this function to your optimizations plugin or to the functions.php file of the active theme:

function clean_header(){ wp_deregister_script( 'comment-reply' ); } add_action('init','clean_header');

Note: Do not do this optimization if you use the WordPress comment system or it will be impossible for users to respond to comments.

Date update on 2021-02-16. Date published on 2021-02-16. Category: Computer class Author: Oscar olg Fuente: ayudawp