HTML Purifier
PHP HTML filtering library that removes malicious code and guarantees W3C-compliant, XSS-safe HTML output.
What is HTML Purifier?
HTML Purifier is a standards-compliant HTML filter library written in PHP that removes malicious code and ensures output documents comply with W3C standards. It offers attribute validation, XSS protection, full UTF-8 support and extensibility for advanced use cases.
What is HTML Purifier for?
- A PHP application that accepts HTML from users (WYSIWYG editors, comments) and needs to sanitise it before storing.
- A content platform where XSS protection on user-submitted HTML is critical.
- A project that needs to guarantee W3C-compliant HTML output.
Main benefits of HTML Purifier
Removes XSS malicious code from user-submitted HTML.
W3C standard compliance in the resulting HTML.
Full UTF-8 support for multilingual content.
Extensible for advanced use cases.
Who should use HTML Purifier?
PHP developers who need to sanitise user HTML before displaying or storing it in the database.
Is HTML Purifier the right choice for you?
It's a great fit if…
- If your application accepts HTML from users and needs XSS malicious code removal.
- If you want to guarantee the stored HTML complies with W3C standards.
- If you handle multilingual content and need robust UTF-8 support.
It might not be for you if…
- If you don't accept HTML from users and only process plain text, where PHP's htmlspecialchars() is enough.
- If you need a full framework, as HTML Purifier is a purpose-specific library.
How to install HTML Purifier on your hosting
Open your hosting panel
Log into your miHosting professional hosting panel and open Softaculous, the application installer included with every plan.
Find HTML Purifier
Integrated into PHP projects as a library, included as a dependency and called at the points where user HTML is processed.
Configure and go live
Choose the domain, language and admin details. Softaculous creates the database automatically and your install is ready in minutes.
Why install HTML Purifier on miHosting
miHosting's professional shared hosting includes Softaculous, PHP and databases already configured, NVMe storage with no artificial limits, free SSL and real technical support if you need help during installation or maintenance of HTML Purifier.
Install HTML Purifier today
Choose the professional hosting plan that best fits your HTML Purifier project, or try it risk-free with the free plan.
Emprendedor
— free domain included*
- ✓3 websites
- ✓1 free domain* the first year (annual billing)
- ✓Unlimited NVMe SSD storage
- ✓Softaculous — 400+ one-click apps
- —Node.js, Python and Ruby are not available with Emprendedor.
- ✓Free, automatic SSL (Let's Encrypt)
- ✓Free migration included
- ✓Real 24/7 technical support
Plus
— free domain included*
- ✓15 websites
- ✓1 free domain* the first year (annual billing)
- ✓Unlimited NVMe SSD storage
- ✓Softaculous — 400+ one-click apps
- ✓Node.js, Python and Ruby access
- ✓Free, automatic SSL (Let's Encrypt)
- ✓Free migration included
- ✓Real 24/7 technical support
Webmaster
— free domain included*
- ✓100 websites
- ✓1 free domain* the first year (annual billing)
- ✓Unlimited NVMe SSD storage
- ✓Softaculous — 400+ one-click apps
- ✓Node.js, Python and Ruby access
- ✓Free, automatic SSL (Let's Encrypt)
- ✓Free migration included
- ✓Real 24/7 technical support
Not sure which to choose?
For 1–3 of your own websites, the Emprendedor plan is more than enough. To manage client sites or multiple projects, the Webmaster plan is the go-to choice for agencies and freelancers.
Node.js, Python and Ruby are included with Plus and Webmaster; they are not available with Emprendedor.
* The first-year free domain is included with the annual price. From the second year onward, it renews at the standard price. Prices in USD. VAT excluded.
Not ready to commit yet?
Try it with the same NVMe infrastructure as the paid plans for 6 months, without a credit card. Your domain is purchased separately and free hosting does not include direct support. Upgrade within those 6 months for a 50% discount.
- ✓ No credit card required
- ✓ Softaculous included
- ✓ Upgrade whenever you want
Frequently asked questions about HTML Purifier
Does HTML Purifier protect against XSS attacks?
Yes, that's its main purpose: removing malicious JavaScript and other XSS vectors from user-submitted HTML.
Is HTML Purifier compatible with any PHP project?
Yes, it's a standalone library that can be integrated into any PHP project, with or without a framework.
Launch your project with HTML Purifier today
Professional hosting with Softaculous, real technical support and a 60-day money-back guarantee.