PHP Scripts & Templates
HTML Purifier
HTML Purifier is a PHP library that cleans user-submitted HTML to block cross-site scripting (XSS).
- Views
- 0
- Clicks
- 0
- Added
- Oct 31, 2026
- Source
- htmlpurifier.org
What you can do with it
- Safely allow formatted comments or posts
- Strip dangerous scripts and attributes
- Fix broken HTML
- Control exactly which tags are allowed
Good to know
If users only submit plain text, escaping output with htmlspecialchars() is simpler.