WP Codex
How To Remove A Script In WordPress With Wp_Dequeue_Script
Use wp_dequeue_script() and wp_deregister_script() with the script handle, hooked late so it runs after the script has been enqueued.
How To Add Inline Javascript In WordPress With Wp_Add_Inline_Script
Attach a small piece of JS to an already enqueued script. Use 'after' to print it after the script, or 'before' to print it before.
How To Use Jquery Correctly In WordPress
Declare jquery as a dependency and wrap your code in a function. WordPress runs jQuery in noConflict mode, so $ is not available globally.
How To Load Javascript With Defer Or Async In WordPress 6.3+
Since WordPress 6.3 you can pass an array as the fifth argument of wp_enqueue_script() to set the loading strategy.
How To Make An Ajax Request In WordPress With Admin-Ajax.php
Register a PHP handler with the wp_ajax_ and wp_ajax_nopriv_ hooks, then call it from JavaScript with fetch(). This example requires the lotgrafixData object from the wp_localize_script() post.


