Word Replacer WordPress Plugin

Update

Version 0.2.3 is available at WordPress.org
Please install/upgrade from your wp-admin or download from WordPress.org
Thank you.

Oct 23, 2011


Word Replacer is a WordPress plugins to replace any desired text/word with your choice. You can filter which content to be replaced, eg. only in page, comment, or post. With very userfriendly administration page you can manage list of word eaasily. It’s also can be used to censor any bad/vulgar words in your comment your your guest posting. It’s simple but useful.

Features

  1. With regex support.
  2. Userfriendly administration page.
  3. Define yourself what word to replace in where. (e.g. a word shoud be replaced in comment but not in post etc)

Changelog:

version 0.2.1

  • Changed: original and replacement field in database is now TEXT type instead of VARCHAR
  • Fixed: plugins will analyze first whether original value in databse is base64 encoded (bug in version 0.2, when upgrade from version 0.1)

version 0.2

  • Regex support
  • Some bug fixes
  • Changed: Now using preg_replace PHP functions, instead of str_replace
  • Added: Replace title and page title
  • Added: Search whole word only
  • Added: Search case insensitive
  • Added: Contextual help
  • Changed: Original words saved to the database is now base64 encoded, to keep character consistency.
  • Added: Expand/collapse options page
  • Removed: initial word value (badword/good word)

version 0.1

  • First release

Screenshot:

Options page:

Help:

Options page (expanded):


Feature Wishlist

Here are  some feature wish lists for Word Replacer Plugin based on user comments:

  • Replace the title
  • Replace Case-insensitive

Uploaded to WordPress.org

This Word Replacer Plugin just approved and uploaded to WordPress Plugins Directory
Please see it in action, here.. http://wordpress.org/extend/plugins/word-replacer/ :D

Note: This post was posted by WP Sub Post Plugin

$10.99 .CO Domains!

Incoming search terms:

  • word replacer
  • wordpress replacer
  • wordpress vulgarity plug in
  • word plugin for wordpress
  • wordpress word filter
  • wordpress word filter plugin
  • takien com word replacer
  • wordpress plugin change word
  • wordpress plugin tag replacement
  • wordpress plugin that removes specific word
  • knn

    I found the bug:
    You have to replace

    $action_url = $_SERVER[PHP_SELF] . ‘?page=’ . $word_replacer['base_name'];

    by

    $action_url = site_url().$_SERVER[PHP_SELF] . ‘?page=’ . $word_replacer['base_name'];

  • Syarianblog

    what code to replace this            style=”display:inline;”>          please, thanks 

  • Syarianblog

    Cara Menghapus code ini gmana ya…. style=”display:inline;”>  terima kasih sebelumnya terima kasih

    • Anonymous

      coba masukkan kode tersebut ke kolom original, di bagian replace kosongkan.

  • http://www.register-web-domain.in Domain registration

    Very interesting blog. I will be waiting for more great and useful information from you in the nearest future.keep up it

  • Toomuch

    Takes way too much CPU and memory. Slows your pages down by about 70%. Good idea but can’t handle the load even when cached.

  • Guest

    Don’t you just love these people that ask questions before they even try it?

  • Blogmeister

    Needs a pre publish function like Text Obfuscator

    • Anonymous

      Pre publish replacement will be considered in the next version.
      thanks. :)

  • Julius

    Hi,
    I like it.
    It would be nice to have the word replacement work only when comments are plublished.
    In my blog a user can edit his comment before I moderate and publish it. If he sees his word replaced in his comment under moderatiot he changes it in a way to skyp the replacement.

    • Anonymous

      wondering if it could be or not.
      anyway what is the problem if user edit their comment?

      • Julius

        Hi,
        for example, if the plugin replaces the word “shit” with “s..t” the user can edit the word to “s h i t” or in some other way he can skip the plugin. 
        If he doesn’t see the replacement until the comment is published he doesn’t change it.
        julius.

        • Anonymous

          I got it.
          edit the plugin at this point:

          [php]
          add_filter(‘comment_text’,         array(&$this,’word_replacer_comment’), 200);
          [/php]

          Replace with:

          [php]

          add_filter(‘comment_text’,         array(&$this,’word_replacer_comment’), 200, 2);

          [/php]

          Next:
          Find this:
          [php]
          function word_replacer_comment($content) {
          [/php]

          Replace with:
          [php]
          function word_replacer_comment($content,$comment) {
          [/php]

          Last step:

          Search for this string:
          [php]
          if($in_comments[$i]    == ‘yes’) {
          [/php]

          Add After:
          [php]
          if($comment->comment_approved == ’1′)
          [/php]

          Note:
          [php] and [/php] is just to tell if that’s a PHP code :D

          • Julius

            Hi,
            it works perfectly.
            Thank you so much!

  • René

    How can I replace the words “Posted on” with another text in my date part of the post? That text is obviously part of the theme.
    Thanks…

    • Anonymous

      Nope, you have to browse through template file and edit it manually. Depend on what theme you are using, some theme use function or filter hook to display the ‘Posted on’ text. If so, see the theme documentation/readme.

      • René

        I know I can edit it manually but I was hoping this plugin could do it without me touching the theme files because I need the change only temporarily. It’s a great plugin nonetheless…

        • Anonymous

          Thanks.
          it’s only a plugin using WordPress filter hook,
          nothing with replacing hard string in a file. you can edit a file using PHP, but yeah, it’s not temporary and very risky since it possibly could break some important PHP code.

          anyway how frequent you will edit that string?

          • René

            I have no problem with hardcoding since it’s a custom theme made from scratch. I was just hoping that I can use this plugin so that I don’t have to change 6 different page templates (twice). It will be changed only for two days. Doesn’t matter, seems like I’ll have to change it manually. Thanks for your help…

          • Anonymous

            You’re welcome,
            if theme is made by yourself, I’d recommend you to wrap the string using a PHP function so it can be easily edited from your own custom options etc.

  • Anonymous

    I have a problem.
    First of all, thanks a lot for the plugin!
    My problem is with ‘ simbol.
    I want to replace “Today’s” with another word, but it doesn’t replace it and sometime he add in the text field a /
    What I can do? Is it a problem of the plugin?

    Thanks a lot!
    diesel701

    • Anonymous

      trying to fix this problem, thank you

      • Anonymous

        Great! :) I wait for a fix! ;)
        Thanks :)