Protect Your Site from Inappropriate Content
Curses! is a lightweight profanity filter designed for frontend templates. Add content moderation to user-generated content, comments, or any text field with simple Twig filters.
Key Features
Smart Pattern Matching Detects common obfuscation techniques users employ to bypass filters
Simple Twig Integration
Fully Configurable
- Define your own word list appropriate for your project
- Customize the mask character (or remove words entirely)
- Multi-environment config support
Usage
Twig Filters
maskProfanity
Masks profanity in text using the configured mask character (default *)
{{ entry.body|maskProfanity }}
{# Output: "This is some **** text" #}
{# Override mask character for this call #}
{{ entry.body|maskProfanity('#') }}
{# Output: "This is some #### text" #}
hasProfanity
Check if text contains profanity:
{% if entry.body|hasProfanity %}
<p class="warning">This content may contain inappropriate language.</p>
{% endif %}
{# As a function #}
{% if hasProfanity(entry.body) %}
{# ... #}
{% endif %}
Installation Instructions
To install this plugin, copy the command above to your terminal.
Reviews
This plugin doesn't have any reviews.
Active Installs
0
License
Craft
Last release
December 3, 2025