I'm getting unwanted
tags in my html code when I put it in an html widget block. I tried below methods but none of the seem to be working.
remove_filter('the_content', 'wpautop');
remove_filter('the_excerpt', 'wpautop');
remove_filter('widget_text_content', 'wpautop');
remove_filter('widget_custom_html_content', 'wpautop');
I entered this html code in the html widget box
<img href="test.jpg">
<span>text</span>
<script>alert("message");</script>
And I get the below code after the widgets are saved. (There are some "p" & "br" tags which isn't needed.)
<p><img href="test.jpg"><br>
<span>text</span><br>
<script>alert("message");</script></p>
(Please click and see the screenshot attached) Screenshot
Please help? Thanks!