PHPackages                             g4b0/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. g4b0/htmlpurifier

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

g4b0/htmlpurifier
=================

A simple wrapper around HtmlPurifier \[http://htmlpurifier.org/\]

2.0.2(7y ago)86.3k7[2 issues](https://github.com/g4b0/silverstripe-htmlpurifier/issues)[2 PRs](https://github.com/g4b0/silverstripe-htmlpurifier/pulls)2GPL-2.0-onlyPHP

Since Nov 21Pushed 3y ago3 watchersCompare

[ Source](https://github.com/g4b0/silverstripe-htmlpurifier)[ Packagist](https://packagist.org/packages/g4b0/htmlpurifier)[ RSS](/packages/g4b0-htmlpurifier/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (10)Used By (2)

HtmlPurifier
============

[](#htmlpurifier)

A simple wrapper around HtmlPurifier \[\]

Introduction
------------

[](#introduction)

This module adds a wrapper named Purifier around the famous HtmlPurifier. You can use HtmlPurifier by itself, or use some of the custom function to have clean HTML or XHTML code, TXT code or to strip the \[embed\] tags. It's also possible to extend the Purifier class to add your own purifier functions.

Requirements
------------

[](#requirements)

- SilverStripe &gt;= 4.1 &lt; 5.0

For 3.x installations refer to the 1.x version

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

[](#installation)

Install the module through [composer](http://getcomposer.org):

```
composer require g4b0/htmlpurifier
composer update

```

Usage
-----

[](#usage)

Whenever you need to purify your HTML code, eg. during OnBeforeWrite, OnAfterWrite or in a custom search, just call the wrapper function:

```
$content = Purifier::PurifyTXT($p->Content);
$content = Purifier::RemoveEmbed($content);
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~168 days

Recently: every ~263 days

Total

9

Last Release

2892d ago

Major Versions

1.0.5 → 2.0.02018-05-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/11ee3ded134711b9ff1d704b1d448a7d3fdfe1b5f5b2e2809cda7eeac8356de5?d=identicon)[g4b0](/maintainers/g4b0)

---

Top Contributors

[![g4b0](https://avatars.githubusercontent.com/u/2427390?v=4)](https://github.com/g4b0 "g4b0 (18 commits)")[![davejtoews](https://avatars.githubusercontent.com/u/9664035?v=4)](https://github.com/davejtoews "davejtoews (1 commits)")

---

Tags

htmlsilverstripehtmlpurifierW3Cseowcag

### Embed Badge

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

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

###  Alternatives

[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5396.5M34](/packages/stevebauman-purify)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1053.2M18](/packages/xemlock-htmlpurifier-html5)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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