So, a js from a plugin is located in the header based on the setting below:

wp_register_script('plugin_min', plugin_url . 'scripts/scripts.min.js' );

Now, I can change it so that it will be located in the footer by editing the plugin file:

wp_register_script('plugin_min', plugin_url . 'scripts/scripts.min.js', array(), false, true );

Of course editing the plugin file is not a good idea since it will be overwritten upon update.

So, to do it properly, should I deregister it first then re-register in the function.php?


Your thought is correct.

By editing the plugin file you lose updatability. So unregistering and reregistering it in the functions.php would be the correct way to do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.