Search Regex Plugin

download

Download Search Regex 1.4.10

56.36 KB - WP 2.0+
Updated January 22, 2010.

Search Regex adds a powerful set of search and replace functions to WordPress. These go beyond the standard searching capabilities, and allow you to search and replace almost any data stored on your site. In addition to simple searches you have the full power of PHP's regular expressions at your disposal.

The driving force behind this plugin is to aid in website migration and upgrading. If you've ever done either of these then you know the pain of having to go back through all your data, changing URL paths and fixing things. With this plugin you can reduce this work to a search and replace pattern and the job is finished in seconds.

Why would you want this? The primary reason for the plugin was to aid in relocating directories. It's a real pain to manually go through every post and change image directory names. With this plugin all that was required was a simple search and replace pattern, and the job was finished in a few seconds.

Features include:

  • Simple search and replace
  • Advanced regular expression search and replaces, including back references and capture groups
  • Search previews with inline replacing
  • Perform searches in post & page content, excerpt, titles, URL, and meta-data, as well as comment content and author data
  • Full support for WordPress roles. You can only search and replace in posts you have access to
  • Fully localized

Get the Flash Player to see this movie.

Version History

  • 1.4.10 - Fix deep slashes
  • 1.4.9 - WP 2.8 compatibility
  • 1.4.8 - Update base library. Fix issue with regex not being selected
  • 1.4.7 - Fix for 2.6 versions
  • 1.4.6 - Added tag & sniplet searching. Make work in Safari

Installation

Installation is just like any WordPress plugin:

  • Download search-regex.zip
  • Unzip
  • Upload directory to /wp-content/plugins on your server
  • Activate the plugin
  • Use Search Regex from the Manage/Search Regex menu

You can find full details of installing a plugin on the plugin installation page.

Usage

Searches can be performed from the Search Regex submenu, contained within the main Manage menu of the administration interface. Once there you will be presented with the following interface:

Search Regex interface

The search and replace patterns are, as you would expect, where you enter what you want to search for and what you want to replace it with. Several options exist to refine the searching capabilities, which will be explained later. You can also chose the data source.

When you have entered your patterns you need to press one of the search buttons:

  • Search - Just do a search and show the results
  • Replace - Perform a search and replace, but only show the results. The database is not changed.
  • Replace & Save - As Replace, but the replacements are saved back into the database.

It should be noted that while you can enter any search pattern in a simple search, you must adhere to regular expression syntax when the regular expression mode is enabled. The plugin will detect any regular expression errors and warn you.

If you wish to remove a search pattern (i.e. search for 'cheese' and delete the any occurrences) then you can leave the replacement pattern empty.

Search Options

The following options modify the search:

  • Regex - Enable regular expressions. Note that the search pattern can now only contained properly escaped characters. The @ character is used as a delimiter and also needs escaping.
  • Case-less - Case insensitive search
  • Multi-line - Enables multi-line mode (see PHP's pattern modifiers page)
  • Dot-all - Enables the dot-all mode (see PHP's pattern modifiers page)

Results

Search results as presented as a list of found occurrences. Each result is shown in context with the surrounding data and, if enabled, the replacement context is also shown.

Preview

Depending upon the data source you have options to view, edit, or replace the data. Additionally, if you double-click on the highlighted search or replace patterns then an inline edit box will appear allowing you to directly edit the data.

Inline Replace

Examples

The simplest case is changing paths:

  /wp-images/

to

  /images/

A more complicated regular expression version to only move PNG images:

  /wp-images/(.*?).png

to

  /images/png/$1.png

Warning

You should always use the Search & Replace preview before saving to the database. I will accept no responsibility for any damage caused to your data. If you are in any doubt then backup your database first.

Support

Please direct all support questions to the Search Regex support forum. Any support questions left on this page may not be answered.

Bugs & New Features

A full list of all bugs can be found in the Search Regex issue tracker.

Date Current requested features
12 Feb 2010 Comment Author IP.

A full list of all requested features can be found in the Search Regex feature tracker.

Help me to save time by reading these instructions!

Please report bugs in the Search Regex issue tracker.

Please make feature suggestions in the Search Regex feature tracker.

Please direct all support questions to the Search Regex support forum.

Comments (page 2 of 3)

Page: 1 2 3
  1. Mihajlo :

    Mar 29, 2009 11:47 am | Reply

    What I cannot understand - is why now working examples?
    Regex isn't actually "a walk in the park"...

    Thanks anyway.

  2. Jason :

    Apr 30, 2009 12:07 pm | Reply

    This may be what I'm looking for (haven't tried it yet) but I build many WordPress pages for clients. I usually start locally on my box using a localhost, then transfer all the data to an online host. This causes headaches primarily with the images uploaded via the WordPress media uploader.

    Looks like an awesome tool to combat that problem quickly! Cheers!

  3. Timothy Schrock :

    Jun 1, 2009 2:38 pm | Reply

    What does it mean when, after clicking on "Replace>>", each return says above it, view | '); return false">replace | edit ??

    I'm on WP 2.7.1

    Thanks.

  4. deb :

    Jun 16, 2009 8:10 am | Reply

    your notes say, "Perform searches in post & page content, excerpt, titles, URL, and meta-data, as well as comment content and author data."

    how do i do a search and replace on a "page," not just a post?

    thanks!

    deb

    • John( author ) :

      Jun 16, 2009 1:31 pm | Reply

      Nothing special is needed: post=page

  5. Don :

    Jun 20, 2009 2:21 am | Reply

    Hi. After reading the doc and the comments on this plugin I've just downloaded it as I'm getting ready to migrate my dev site to a production host. This plugin should save a LOT of time.

    Being a bit rusty on Regex (its been a while since I've done full bore UNIX) I did a Google search and came across a ref that others might find handy: http://www.funduc.com/regexp.htm.

    If you're new to regex, study it carefully and it will make sense. There are examples given.

    Hope this helps.

  6. mark :

    Jun 26, 2009 2:00 pm | Reply

    seems that after the update to 2.8 of wordpress, the replace as well as replace and save functions no longer work properly. Any ideas?

    • John( author ) :

      Jun 29, 2009 3:22 am | Reply

      The plugin is not 2.8 compatible yet

  7. Praz :

    Aug 16, 2009 11:55 am | Reply

    is it possible to search post meta key for posts?

  8. Dragon :

    Aug 29, 2009 10:28 am | Reply

    Thanks for this plug-in!

    Can this search admin pages? I want to replace simple text such as the word "post" to the word "tribute".

    Thanks.

    • John( author ) :

      Sep 9, 2009 2:52 pm | Reply

      What do you mean by admin pages?

  9. Rob :

    Oct 2, 2009 9:32 am | Reply

    I'm anxious to try this one out, as I just moved a bunch of files around on my site.

  10. Pablo :

    Dec 11, 2009 4:11 pm | Reply

    This plugin totally rocks. We used to replace some youtube plugins machine tags. It was so quick and painless, but we still backed up the database. ;)

    • John( author ) :

      Jan 23, 2010 11:25 am | Reply

      Added to the plugin, thanks!

  11. Jason Meagher :

    Jan 25, 2010 8:30 pm | Reply

    Sir, thank you. Nice little interface. Saved me hours.

    jm

Page: 1 2

Pings & Trackbacks

wpstation.com, wordpresscn.com, plasticdreams.org, dltj.org, wordpresscn.com, smashingmagazine.com, tecnoblog.net, blogpiloten.de, xuyiyang.com, sparanoid.com, clarkburbidge.com, mr-foto.net, perraco.com, shakin.ru, psicofxp.com, rehlaonline.com, zhangzhang.net, rehlaonline.com, facemakers.stu.ru, triumphalroman.net, midasoracle.org, venukb.com, rehlaonline.com, newsoft.com.ua, alabase2.com, themelab.com, 1wordpress.com, readers-edition.de, desperatelyseekingwp.com, devilsworkshop.org, parandroid.com, onecho.com, onecho.com, goodyao.cn, volkandesign.com, onu7.com, pi-kun.com, wp-plugin-archive.de, 1stwebdesigner.com, neurosoftware.ro, davepit.com, zdaylan.com, sjwets.nl, acunetix.com, michelfortin.com, nicksimnews.com, csscody.com, allpctips.net, bizsoftlab.com, freewordpressthemes.us, qwertyweb.ru, seozebra.ru, wordpress.blogos.dk, dalog.tokyolife.org, fosfo.ru, wptime.com, sisadmin.net.ru, barneyb.com, wp-dir.com, hqwordpress.com, 60m.org, davidchinphoto.com, wp.sk, com5.info, blog.neptis.info, vocidalweb.it, ebooktm.com, akgun.6te.net,

Leave a Reply


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Help me to save time by reading these instructions!

Please report bugs in the Search Regex issue tracker.

Please make feature suggestions in the Search Regex feature tracker.

Please direct all support questions to the Search Regex support forum.

Home | Main content | Software | Terms & Conditions | Sitemap | John Godley © 2010