How to Remove jQuery From WordPress Header


By default, WordPress include its own copy of jQuery file in your blog posts and pages headers, calling wp_enqueue_script(‘jquery’). If your website doesn’t use jQuery and you want to get rid of this jQuery which is included by default, here is how you can, paste the code below into your functions.php file:

if ( !is_admin() ) wp_deregister_script('jquery');
 

Removing unnecessary script files will make your website loading faster.
Note: use if ( !is_admin() ), otherwise some function in WordPress admin panel will be unusable.

See also  How to Customize Number of Posts in Wordpress Page Navigation

Leave a Reply

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