0

I have troubles with Wordpress. I need to remove this includions

*-> /wp-includes/js/jquery/jquery.js?ver=1.12.4<br>
-> /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1*

As you can see on the picture below, I'm using own compiled and minified version of scripts, where I also have jquery...

I would like to remove that older default wordpress version from including.?

enter image description here

Here is some code that I have tried before posting this:

function my_jquery_enqueue() {
    wp_deregister_script('jquery');
}

add_action( 'wp_jquery_customer', 'my_jquery_enqueue' );
add_action( 'wp_nopriv_jquery_customer', 'my_jquery_enqueue' );

Thanks for helping. :)

1 Answer 1

3

you need to use wp_enqueue_scripts

so your function should look like this:

function my_jquery_enqueue() {
    wp_deregister_script( 'jquery' );
}

add_action( 'wp_enqueue_scripts', 'my_jquery_enqueue' );

More Details your can read about wp_enqueue_scripts at:

Reference

Sign up to request clarification or add additional context in comments.

1 Comment

@AndrejV. your are Welcome :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.