PHPackages                             sank3/htmlpurifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sank3/htmlpurifier

ActiveLibrary

sank3/htmlpurifier
==================

Standards compliant HTML filter written in PHP

4.20.1(5y ago)098LGPL-2.1-or-laterPHPPHP &gt;=5.2

Since Feb 18Pushed 4y agoCompare

[ Source](https://github.com/sank3/htmlpurifier)[ Packagist](https://packagist.org/packages/sank3/htmlpurifier)[ Docs](http://htmlpurifier.org/)[ RSS](/packages/sank3-htmlpurifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (24)Used By (0)

HTML Purifier [![Build Status](https://github.com/ezyang/htmlpurifier/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/ezyang/htmlpurifier/actions/workflows/ci.yml)
=========================================================================================================================================================================================

[](#html-purifier-)

Forked From

Improvements-

- HTML5 new element support - nav, section, article, aside, header, footer, address, hgroup
- Images/Media embeds - video, figure, figcaption
- Form Attributes added - placeholder, required
- Input type enum extended to - button, checkbox, color, date, datetime-local, email, file, hidden, image, month, number, password, radio, range, reset, search, submit, tel, text, time, url, week
- HTML5 Data attributes - will not be removed and parsed as it is. Supported only if HTML.Trusted is set

=============

HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and aggressive parsing to ensure that not only are XSS attacks thwarted, but the resulting HTML is standards compliant.

HTML Purifier is oriented towards richly formatted documents from untrusted sources that require CSS and a full tag-set. This library can be configured to accept a more restrictive set of tags, but it won't be as efficient as more bare-bones parsers. It will, however, do the job right, which may be more important.

Places to go:

- See INSTALL for a quick installation guide
- See docs/ for developer-oriented documentation, code examples and an in-depth installation guide.
- See WYSIWYG for information on editors like TinyMCE and FCKeditor

HTML Purifier can be found on the web at:

Installation
------------

[](#installation)

Package available on [Composer](https://packagist.org/packages/sank3/htmlpurifier).

If you're using Composer to manage dependencies, you can use

```
$ composer require sank3/htmlpurifier

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~141 days

Recently: every ~40 days

Total

21

Last Release

2007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e2c211f0ebf53c77039f8a8fc0833f9858b48cd3e247072e5f66e775bd8f676?d=identicon)[sank3](/maintainers/sank3)

---

Top Contributors

[![ezyang](https://avatars.githubusercontent.com/u/13564?v=4)](https://github.com/ezyang "ezyang (261 commits)")[![sank3](https://avatars.githubusercontent.com/u/34004129?v=4)](https://github.com/sank3 "sank3 (23 commits)")[![bytestream](https://avatars.githubusercontent.com/u/1788397?v=4)](https://github.com/bytestream "bytestream (6 commits)")[![xemlock](https://avatars.githubusercontent.com/u/952555?v=4)](https://github.com/xemlock "xemlock (6 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (4 commits)")[![Xiphin](https://avatars.githubusercontent.com/u/3348428?v=4)](https://github.com/Xiphin "Xiphin (3 commits)")[![zerocrates](https://avatars.githubusercontent.com/u/298975?v=4)](https://github.com/zerocrates "zerocrates (2 commits)")[![kish0808](https://avatars.githubusercontent.com/u/44048735?v=4)](https://github.com/kish0808 "kish0808 (2 commits)")[![mpyw](https://avatars.githubusercontent.com/u/1351893?v=4)](https://github.com/mpyw "mpyw (2 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (2 commits)")[![mtibben](https://avatars.githubusercontent.com/u/980499?v=4)](https://github.com/mtibben "mtibben (1 commits)")[![ngnpope](https://avatars.githubusercontent.com/u/2855582?v=4)](https://github.com/ngnpope "ngnpope (1 commits)")[![okainov](https://avatars.githubusercontent.com/u/918446?v=4)](https://github.com/okainov "okainov (1 commits)")[![PHPGangsta](https://avatars.githubusercontent.com/u/608408?v=4)](https://github.com/PHPGangsta "PHPGangsta (1 commits)")[![r-kovalenko](https://avatars.githubusercontent.com/u/2025625?v=4)](https://github.com/r-kovalenko "r-kovalenko (1 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (1 commits)")[![royopa](https://avatars.githubusercontent.com/u/442991?v=4)](https://github.com/royopa "royopa (1 commits)")[![SandroMiguel](https://avatars.githubusercontent.com/u/6423157?v=4)](https://github.com/SandroMiguel "SandroMiguel (1 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![skodak](https://avatars.githubusercontent.com/u/241453?v=4)](https://github.com/skodak "skodak (1 commits)")

---

Tags

html

### Embed Badge

![Health badge](/badges/sank3-htmlpurifier/health.svg)

```
[![Health](https://phpackages.com/badges/sank3-htmlpurifier/health.svg)](https://phpackages.com/packages/sank3-htmlpurifier)
```

###  Alternatives

[ezyang/htmlpurifier

Standards compliant HTML filter written in PHP

3.3k327.6M445](/packages/ezyang-htmlpurifier)[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.6k34.7M186](/packages/phpoffice-phpword)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k28.6M199](/packages/league-html-to-markdown)[picqer/php-barcode-generator

An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.

1.8k25.5M88](/packages/picqer-php-barcode-generator)[soundasleep/html2text

A PHP script to convert HTML into a plain text format

48519.5M75](/packages/soundasleep-html2text)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
