hooks – Removing script tags that are loaded by other script tag
I have a third party script tag that embeds a form that loads its own scripts and styles. Those loaded scripts include jQuery among others, and since i already used WP’s own jQuery i want to remove the third party jQuery script. I’ve tried
the_content hooks to no avail since they only gave me the original script tag before it loads the other scripts.
Is there a hook that deals with the final HTML after every script is downloaded and parsed? Then i could just do a filter by regex on it.
Also, the scripts when loaded are appended as
async so that complicates things up. Is it possible to prevent the scripts to execute?