WP_Censor

September 4th, 2008

WP_Censor is a free plug-in for WordPress that allows you set-up censored keywords or phrases allowing you to quote freely and not have to manually censor the text as you insert it. Functionality has been added to hide censored text and allow the user to decide whether to see the text. WP_Spoiler has been merged into WP_Censor to allow you not just the ability to censor, but to also hide spoiler text.

Installing WP_Censor

  • download WP_Censor.
  • Copy to your ‘wp-content/plugins‘ directory.
  • Log in with an administration account.
  • Select the ‘Plugins‘ tab.
  • Scroll down to ‘WP_Censor’ and click ‘activate‘.

Options

Log into WordPress with an Administrator login and select “Settings->Censor” on the dashboard menu.

Admin Screen

There are three styles of censoring depending on your preference or what you are censoring.

  • Government
    • Description: This is based on what you tend to see in released government document that are censored to still withhold some information.
    • Example: Dear Mr AccountHolder, your bank account 000000 00000000 , is overdrawn.
  • Newspaper
    • Description: This is based on how newspapers often censor swear words, leaving enough of a it for your to deduce the real word.
    • Example: The attacker told him to “fuck off”.
  • Comic
    • Description: This is based on how swear words are often done in comics. Totally obscuring the word, and less harsh that the solid black bar.
    • Example: oh shit.

Hide and reveal content

To use WP_Censor’s hide and revel feature insert the following BBCode shortcode into your post encasing the text you wish to conceal.

To hide censored content.

[censor demo="true" ]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent porttitor elit eget.
[/censor]

Which will appear as follows

[censor]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent porttitor elit eget.

[/censor]

or to add spoiler content

[spoiler demo="true" ]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent porttitor elit eget.
[/spoiler]

Which will appear as follows

[spoiler]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent porttitor elit eget.

[/spoiler]

Version History

  • 1.0.0
    • Initial Public Release.
  • 1.1.0
    • Added hide and revel censorship
  • 2.0.0
  • 2.1.0
    • Updated Libraries

Future Developments

  • Ability to censor on save rather than on the fly.
  • Ability to replace offensive words with chosen inoffensive terms.

Other Plug-ins

If you liked this plug-in visits our download area where you will find many more.

Bugs & Suggestions

If you have questions, have found any bugs, or you would like to see features added to WP_Censor please feel free to use the form at the bottom of the page to Contact us. If WP_Censor doesn’t fill your needs , feel free to Contact us to discuss a specially commissioned plug-in.

Show Your Appreciation

If you liked WP_Censor please:

You can also make a donation to Help support its development.


  1. May 23rd, 2008 at 17:35 | #1

    Nice and useful plugin, but you may want to re-code the admin panel so that it appears under “Options” instead of taking up a main Admin category… (Also, “Manage” doesn’t tell me much about it) - Just use “WP-Censor” under the Options menu, like every other plugin.

  2. June 4th, 2008 at 18:32 | #2

    I downloaded this plugin as a precaution for my new site. Boy, this plug would be lights out if you could enter all the words you want censored and it did a “global” search of posts and automatically censored the words. Maybe tied to the save post command. I will keep you informed of success and failure. thanks for the plugin

  3. June 4th, 2008 at 18:41 | #3

    The point of the plugin was to keep the original text intact.
    But I can see your point. It ill be considered for inclusion as an option for later versions.

  4. July 24th, 2008 at 06:39 | #4

    Hey great plugin, I needed one of these! Are there plans to have this be developed further, in the sense that users can save a profile of what version of the website they want to see between censored or raw? (also, is that what you mean by “Ability to censor on save rather than on the fly?” If so, then you are way ahead of me.

  5. July 24th, 2008 at 09:53 | #5

    @Ted: What is mean by the ability to censor on save, is it will modify the post as it is saved, making it irrevocably censored. This would be quicker, and independent of the plugin. This of course would be optional.
    I’ve not sure what you mean by the profile,you could turn off the plugin to see the raw site. Can you explain further?

  6. elle
    September 10th, 2008 at 00:22 | #6

    hello

    I just used the automatic upgrade feature of WP to upgrade your plugin and I got the following warning:

    Downloading update from http://downloads.wordpress.org/plugin/wp-censor.3.0.0.zip

    Unpacking the update

    Deactivating the plugin

    Removing the old version of the plugin

    Installing the latest version

    Plugin upgraded successfully

    Attempting reactivation of the plugin

    Warning: key_exists() [function.key-exists]: The second argument should be either an array or an object in /home/xxxxxxx/public_html/blog/wp-content/plugins/wp-censor/library/index.php(156) : eval()’d code on line 17

    and then below it

    Plugin reactivated successfully.

    Do I have to do anything about this or is it ok since it says it reactivated successfully.

    Thanks

  7. September 10th, 2008 at 10:41 | #7

    @elle:
    Everything is just fine. The is a small bug that when the plugin is first run, it refers to settings that have not yet been set. This will be fixed in future release, but should not affect you once you have setup the plugin.

  8. elle
    September 10th, 2008 at 23:28 | #8

    Thanks!

  9. September 11th, 2008 at 12:16 | #9

    Nice idea! Is it possible to apply this plugin to comments like WP-Politeifier does?

  10. September 11th, 2008 at 22:16 | #10

    José Luís : this is planned for a future version, but is not yet implemented.

  11. September 12th, 2008 at 04:53 | #11

    Great! I can’t wait for it!

  12. September 28th, 2008 at 20:06 | #12

    Sorry I didn’t come back in a while, had to deal with some stuff.

    Basically what I mean is that there would be two buttons somewhere on the site’s frontend: a “censored” button and an “uncensored” button. If censored was chosen (and it would be chosen by default,) the content of the website would be censored out. But if uncensored was chosen by the visitor, they would get an uncensored version of the site, and the website would remember their choice for the next time they visit.

    What do you think?

  13. KC
    October 31st, 2008 at 10:09 | #13

    Hi,

    Do spider catch up those links or words within censor?
    If not do you have any suggestion that can protect the content from spider?
    Thanks!

  14. November 5th, 2008 at 10:01 | #14

    @JC,
    A would see exactly what a public user would see, IE the censored post.

  15. February 16th, 2009 at 03:35 | #15

    Hi, DCoda!

    Any news (ETA) on that new version that censors not only posts and pages but also comments?

    Thanks once again!

  16. June 26th, 2009 at 15:42 | #16

    DCoda, what if one adds the following line to wp-censor/project/censor/index.php?
    add_filter ( 'comment_text', array ($this, 'filter' ) );

  1. June 27th, 2008 at 09:31 | #1
  2. July 5th, 2008 at 00:15 | #2