PHP-XSS-Filter Install composer require jblond/php-xss-filter Example require './xss_filter.class.php'; $xss = new xss_filter(); $string = '<iframe>blah'; $string = $xss->filter_it($string ); echo $string; Contribute Open a PR, open an issue