Our World Filter Plugin
A lightweight WordPress plugin for filtering selected words in post and page content through a simple admin settings page.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/atta3554/wp-word-filter-plugin/archive/refs/heads/main.zipReadme
Word Filter Plugin
A lightweight WordPress plugin that lets administrators define a comma-separated list of words and automatically replace those words in post and page content.
This is a small WordPress plugin project created to demonstrate basic plugin development concepts, including admin menus, WordPress options, hooks, nonce verification, capability checks, sanitization, and custom admin styling.
Features
- Adds a dedicated Word Filter menu to the WordPress admin dashboard
- Accepts a comma-separated list of words
- Stores the configured word list using the WordPress Options API
- Filters post and page content using the
the_contenthook - Replaces matching words with
&&&& - Includes nonce verification and administrator capability checks
- Loads custom CSS only on the plugin's admin page
- Uses a custom SVG admin menu icon
Installation
-
Download or clone this repository.
-
Copy the plugin folder into:
wp-content/plugins/word-filter -
Log in to the WordPress admin dashboard.
-
Go to Plugins and activate Our Word Filter Plugin.
-
Open Word Filter from the admin menu.
-
Enter the words you want to filter, separated by commas.
-
Click Save Changes.
Example
Enter the following value in the plugin settings:
book, tree, table
When one of these words appears in post or page content, it will be replaced with:
&&&&
Project Structure
wordFilter/
├── custom.svg
├── index.php
├── styles.css
└── README.md
WordPress Concepts Demonstrated
- Plugin headers
- Actions and filters
- Admin menu and submenu pages
- WordPress Options API
- Nonce verification
- User capability checks
- Input sanitization and output escaping
- Conditional admin asset loading
- Object-oriented plugin structure
Notes
This is a simple educational project and is not intended to provide advanced moderation features. Matching is currently case-sensitive, and the replacement text is fixed to &&&&.
License
This project is available for educational and portfolio purposes.