How to Remove jQuery Migrate from WordPress?

— Published on: July 3rd, 2018

When it comes to website optimization, even an additional request matters a lot, especially when users are accessing it from the mobile platform. jQuery is the biggest javascript file which is loaded alongside your theme. If your theme uses a mobile menu or similar jQuery based functions, you will require jQuery anyway, but jQuery Migrate is just an additional file which loads with jQuery. Most of the time it is not required unless we are using decade-old functions. So in this tutorial, I am going to explain how to remove jQuery Migrate from WordPress.

jQuery Migrate

Make a backup of everything before you start any editing.

1. Open Theme’s “functions.php” File and Add Following Code

Note: If you are not familiar with PHP then get some help, because you may break anything.

Locate functions.php file and add the following code at the end of the page.

// Remove jQuery Migrate
function atulhost_optimize_scripts() {
add_action('wp_enqueue_scripts', 'atulhost_optimize_scripts');

2. Save the “functions.php” File and Purge the Cache

Simply save the file and delete all the cache to see it in action. Now check the homepage’s page source and look for jQuery Migrate script, it should be removed.

This is how we can remove jQuery Migrate script from WordPress.

Published in Science and Technology &

About AtulHost

Hi, I'm Atul Kumar Pandey; also known as AtulHost on the web, a blogger by profession with an objective of sharing fresh and real contents in the business and technical topics; from contents to useful resources it's all here.

Leave a Reply