Categories
WordPress

How to Remove the Comments Script from WordPress

Here’s another quick tip for reducing the number of scripts that WordPress loads by default. We’ve already looked at emojis and embeds, so this time we’re looking at comments. If you either don’t want to make use of the comments feature provided by WordPress – perhaps you’re using a third-party plugin like Disqus – or […]

Here’s another quick tip for reducing the number of scripts that WordPress loads by default. We’ve already looked at emojis and embeds, so this time we’re looking at comments.

If you either don’t want to make use of the comments feature provided by WordPress – perhaps you’re using a third-party plugin like Disqus – or if you’re being really strict on the additional scripts that are being loaded for performance reasons, then just add the following snippet to your functions.php file to disable the comments script.

// Disable comment-reply.min.js (enabled by default) if you have no need for the built-in comments feature WordPress provides - RobCallaghan.co.uk

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

Try out the snippet above and let me know how it goes for you.

One reply on “How to Remove the Comments Script from WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *