Using the Search Regex plugin for Wordpress successfully
December 22nd, 2008
If you sometimes need to search and replace some text throughout your weblog, you should definitely be using Urban Giraffe's Search Regex. With Search Regex you can search and replace text in all the fields shown in the picture below:

Search Regex
If you are replacing some text, first enter the Search pattern and press the Search button. This will show you the results, so you can fine tune the pattern to get only the results you want. You also get a set of links to view and edit the post. Very handy.

Search Regex results
If you are satisfied with your search results, you can enter the Replace pattern. Then press Replace button. You will get all list of all the search results together with the preview of how the text will look like after the replace. Now you can manually decide if you want to replace each one of search results by clicking replace.

Search Regex replace
When replacing some text on your website always make sure to search through each of these fields (use the Source drop-down menu):
- Post content
- Post meta value (catches meta descriptions and keywords)
- Post title
- Post excerpt
Replacing the word in Post content is often not enough, if you don't also search Post title and Post meta and Post excerpt you will miss instances.
While it's possible to have changes made immediately (Replace All), we recommend you that you avoid Replace & Save, as this will alter your posts immediately. Use only if you are 100% sure what you are doing and you have a huge number of changes to make.
Search Regex has even more powerful replacement options, via regular expressions. If you have some programming skills and you understand Perl compatibile Regular Expressions you can check Regex checkbox and extend the functionality of this great plugin.
Regular expression on the following screenshot will search for every occurance of word 'easy' without blank space before it.

Search Regex regular expressions
Writing about regular expressions could be a subject to a whole new article or even set of articles. If you want to know more about regular expressions, here are some interesting links:
- http://php.net/manual/en/reference.pcre.pattern.syntax.php
- http://www.phpf1.com/tutorial/php-regular-expression.html
So remember to be extra careful when using the replace function and good luck fixing your articles.

What’s wrong with Wordpress All-in-One-SEO Plugin
How to Sponsor a WordPress Theme Successfully | How to audit a theme sponsorship
Trouble with DD Add Signature Plugin
Redesign the WordPress Login via a Plugin
Leave a Reply