ezyang/htmlpurifier
Standards compliant HTML filter written in PHP observed · 2026-10-14
Health v2 · maintenance only
86/100
- Activity 98
- Release rhythm 63
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-22. Adoption (stars, forks) is never an input.
- gap_med: 341.0
- age_days: 6694
- days_rel: 36
- days_push: 16
- n_releases_24m: 3
Adoption not part of the score
3348 stars · 363 forks observed · 2026-10-14
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
HTML Purifier is a PHP library that filters HTML input using whitelists and aggressive parsing to remove XSS attacks while producing standards-compliant HTML. It is designed for sanitizing richly formatted documents from untrusted sources.
Use cases
- sanitize user-submitted html to prevent xss
- filter rich text from wysiwyg editors like tinymce
- clean untrusted html while preserving css and formatting
- make user html standards compliant
- allow a restricted whitelist of html tags in comments
When to choose
- you need to accept richly formatted html from untrusted users
- standards-compliant output matters as much as security
- you need fine-grained whitelist configuration for tags and css
When to avoid
- you only need to strip all html and escape plain text
- performance is critical and a bare-bones sanitizer suffices
- your project is not written in php
Facets
library · maturity maintenance
security parser templating security web-development backend php html-filtering xss-protection html-sanitization whitelist web-server
1 source
- readme: https://github.com/ezyang/htmlpurifier · fetched 2026-10-14 · b27302f5e4c6
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| ezyang/htmlpurifier | main | 86 |
For agents
markdown · JSON · MCP: product_card(name="ezyang/htmlpurifier")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem