ezyang/htmlpurifier
Standards compliant HTML filter written in PHP observed · 2026-08-28
Health v2 · maintenance only
71/100
- Activity 97
- Release rhythm 20
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 350
- age_days: 6644
- days_rel: 320
- days_push: 21
- n_releases_24m: 2
Adoption not part of the score
3349 stars · 359 forks observed · 2026-08-28
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-08-28 · b27302f5e4c6
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| ezyang/htmlpurifier | main | 71 |
For agents
markdown · JSON · MCP: product_card(name="ezyang/htmlpurifier")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem