— regexp search and replace WordPress plugin

Well, if you put some comments at this page — i will thank you a lot :-)

20090806: Updated to 0.2.0, new features. You can download or take a look at new screenshots, as usually, at WordPress extensions site.


  1. Screenshots
  2. Installation
  3. Usage examples
  4. Download
  5. To do
  6. Version history — WordPress plugin wich searches content for some regular expression and replaces matching string with specified stuff. It performs this «on the fly», without database content modification. It can be used to substitute virtually anything — you can insert custom smiles, cross-links, make typographic corrections (like replace quote symbols, insert   where it needed or the like), invent your own markup language etc-etc.

Usage examples see below.

Screenshots stores it’s data in a blog’s database and has graphical interface:

Insert entry window:

Edit entry:

List of entries:


Donwload module, unpack to wp-contents/plugins directory and activate via management interface. Now you can use it.

Usage examples

  • Custom smiles. Let’s say, we want to replace string YEAH with smile image from Kolobok collection — on each post or page.

    We need to insert something like this:

    ID 7
    Any text that helps you identify this entry
    Search for
    What is should search for
    Replace with
    What should place instead
    Order of this entry
  • Replace quotes with «/». We just need to replace “ with « and ” with ».
  • Easy inserting YouTube fragments. Let’s say we insert YouTube fragmets very often, and we tired to remove non-standard embed and type xhtml1.0-aware object, so we may wish to write something like YouTube->kIUCTbi_XZs and see instead a video.

    So, we need to insert an entry:

    ID 8
    Any text that helps you identify this entry
    Search for
    What is should search for
    Replace with
    What should place instead
    Order of this entry
  • It’s quite easy to implement the functionality of cross-linker plugin and add the possibility to open links in new window, and to add rel="nofollow" etc-etc.
  • You may want to implement «better typography» — replace space after dot with <span style="letter-spacing: 130%"> </span>, and after that replace with a space (entry with greater re_order). Bgha-gha… Or more real things — you can replace with non-breaking space, and \ with by entry with higher «order» number.
  • Want to insert drop caps easily?.. Use <drop>L</drop>orem ipsum... in your posts and replace it with <span class="dropcap">\1</span>. Use angle brackets, and if you (accidentally) deactivate , these «tags» won’t mess you page.


You can download plugin here.

Your bugreports, suggestions, requests etc will be welcomed nice smile

(i’m not a programmer, really, i know)

To do (or not to do)

  1. Make deinstaller
  2. Think about export-import of database?

Version history

  • 0.2.0:
    1. Different replaces for authenticated and guests, pages and not pages…
    2. Option to display list of replaces with HTML chars escaped or not
  • 0.1.4:
    1. Added a (beta-)possibility to specify different replaces for authenticated users and guests
  • 0.1.2:
    1. The plugin directory is now called «replace» — with no dot. Reason — Codex strips that dot anyway, and plugin does not work without prior manual intervention. :-(
  • 0.1.1:
    1. added re_order column.
    2. you do not need to enclose pattern in slashes any more.
  • First version — 0.1.0. Quite usable. nice smile

One Reply to “ — regexp search and replace WordPress plugin”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.