InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Wordpress performance

  • Embed youtube video with on-click lazy loading
  • How to Preload cache in wordpress on Linux
  • How to remove jquery-migrate.js from wordpress
  • How to use wordpress facebook plugin comments box with lazy loading
  • Performance tips for Wordpress site
  • w3 total cache for wordpress
 
  • Home
  • > Tutorials
  • > Wordpress
  • > Wordpress Performance

How to remove jquery-migrate.js from wordpress

By admin on Jan 17, 2016

In case you want to remove jquery-migrate.js for performance reasons, here is the code you can use. Note that this may break some plugins or legacy code. So make sure you do enough testing before removing jquery-migrate.js.

Using wp_default_scripts filter

add_filter( 'wp_default_scripts', 'remove_jquery_migrate' );
function remove_jquery_migrate( &$scripts) {
  if(!is_admin()) {
    $scripts->remove( 'jquery');
    $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.11.3' );
  }
}

Replace 1.11.3 with the latest jquery version that comes with wordpress. Also note that above code will remove jquery from wordpress front end and not from admin pages.

Using wp_deregister_script and wp_enqueue_script

// remove jquery-migrate
add_action( 'wp_enqueue_scripts', 'remove_jquery_migrate' );
function remove_jquery_migrate() {
  if (!is_admin()) {
    wp_deregister_script( 'jquery' );
    wp_enqueue_script('jquery', includes_url( '/js/jquery/jquery.js' ),false, '1.11.3');
  }
}

Suggested posts:

  1. Using Google analytics SDK v2 for android app real time tracking
  2. Bulk convert jpeg files to png using sips on mac
  3. prevent wordpress xmlrpc.php attack
  4. Get file size in bytes on Linux
  5. How to setup wordpress custom query params with pretty url format
  6. WordPress – how to add filter to description meta tag
  7. Command line – run python webserver
  8. How to display date in wordpress pages
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Wordpress, Wordpress Performance
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress