I need to remove a specific line from the header when opening the site. How do I do this using a filter?
<script src="url" data-pn-plugin-url="www.site.com/folder" data-pn-wp-plugin-version="1.0.0" type="text/javascript" async>
Thanks!
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
That script looks like it is coming from some plugin. You’ll need to dig into the plugin files to see how the script is added. If it is enqueued, then you can use wp_dequeue_script(). If it is added with an action (e.g. function that echoes the tag to wp_head), then use remove_action().
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0