hooks – Removing script tags that are loaded by other script tag

Question

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 wp_head, wp_footer, 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?

0
David Quoosp 2 months 2022-09-27T04:06:54-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse