ralkage/flarum-ext-word-censor

Configurable word censoring with per-user toggle. On by default for guests and registered users.

Maintainers

Package info

github.com/Ralkage/flarum-ext-word-censor

Homepage

Type:flarum-extension

pkg:composer/ralkage/flarum-ext-word-censor

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0-beta.8 2026-03-21 23:57 UTC

This package is auto-updated.

Last update: 2026-03-22 00:23:07 UTC


README

License: MIT

Configurable word censoring extension for Flarum with a per-user toggle. Censoring is on by default for all users, including guests.

Features

  • Admin-defined word list — Add words or phrases to censor, one per line
  • Configurable replacement character — Choose what character replaces censored letters (default: *)
  • Always on for guests — Unauthenticated visitors always see censored content
  • Per-user toggle — Registered users can disable censoring from their account settings
  • Display-time only — Original post content is preserved in the database; censoring is applied at render time
  • HTML-safe — Only censors visible text, leaving HTML tags and attributes intact

How It Works

When a post is serialized for the API response, the extension checks:

  1. Guest? → Always censor
  2. Registered user with censoring enabled (default)? → Censor
  3. Registered user who disabled censoring? → Show original content

Censored words are matched using word boundaries to avoid false positives (e.g., "ass" won't match "assistant"). Matching is case-insensitive.

Example

Word list:

damn
crap

Original post: This is a damn good example Censored view: This is a **** good example

Installation

composer require ralkage/flarum-ext-word-censor
php flarum cache:clear

Enable the extension in the admin panel under Extensions > Word Censor.

Configuration

Admin Settings

Navigate to the Word Censor extension settings page:

Setting Description
Censored Words One word or phrase per line. These will be replaced when displayed.
Replacement Character Character used to replace each letter of a censored word. Default: *

User Settings

Registered users can toggle censoring on/off from Settings in their account page. The toggle is labeled "Enable Word Censoring".

Requirements

  • Flarum ^1.8
  • PHP 8.0+

Links

License

MIT License. See LICENSE for details.