Skip to Content


Removes jQuery Migrate (but keeps jQuery)

PHP April 26, 2017


This function runs automatically, so it is not called manually. Is this incorrect?

Additional Notes

jQuery is registered with jQuery Migrate, so WordPress (by default) enqueues them both. This function dequeues both, and then re-enqueues jQuery alone.

Source File

Located in /libs/Optimization.php on line 745.

No Hooks

This function does not have any filters or actions available. Request one?
        public function remove_jquery_migrate($scripts){
            if ( !$this->is_admin_page(true) && !is_admin_bar_showing() && $this->get_option('jquery_location') !== 'wordpress' ){
                $scripts->add('jquery', false, array('jquery-core'), null);


This function can not be short-circuited with an override filter. Request one?