Search Regex

Description

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.

Search Regex is available in the following languages:

  • English
  • Arabic, thanks to R.SN
  • Belarussian, thanks to Marcis Gasuns

Documentation

Full documentation can be found on the Search Regex Page page.

Screenshots

  • Search options
  • Inline search and replace

Installation

The plugin is simple to install:

  1. Download search-regex.zip
  2. Unzip
  3. Upload search-regex directory to your /wp-content/plugins directory
  4. Go to the plugin management page and enable the plugin
  5. Configure the plugin from Management/Search Regex

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

Reviews

Simple and quick

Thank you for making this plugin. A simple search and replace does the job. Cleared out all the old shortcode from posts within a few seconds.

Great plugin

Useful for fixing/updating old links, shortcodes no longer needed, uses of graphics, etc. Just a great plugin for all around maintenance on large websites.

Adding support for custom posts

The search includes all post types, except when searching by post content, in which case it only considers pages and posts.

In order to make search by post content work with all post types, change line 7 of searches/post_content.php

from
$sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' AND post_type IN ('post','page') ORDER BY ID ".$orderby;

to
$sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' ORDER BY ID ".$orderby;

Awesome! Splendid! It really rocks! 2 🙂

Whow! I don’t know how many thank’s I could give!
Search Regex Plugin works fine and strong with my new WP 4.8 imported from a Joomla! I can say how many time SRP is saving for me 🙂
Oh please please please, go on maintain this plugin !
Regards

Awesome! Splendid! It really rocks!

Since 2009 to today, my “more than 150 posts” site would be date replaced monthly, line by line.
Example: Stock empty in:(Shows actual javascript date ), normal stock in:

(date to be replaced)

With my ZERO SQL or Javascript knowledge, with your plugin it´s very easy, just 3 simple steps:
1)SEARCH PATTERN: (put info to be discovered) and REPLACE PATTERN:(put info to be replaced) , click in SEARCH;
2)After listed terms, click in REPLACE: A complete list of “BEFORE” and “AFTER” terms will appear;
3)Click in REPLACE AND SAVE: That´s it! DONE! Simple as 1,2,3!

WOW! 2 hours per month… for 8 years= 96 months x 2 = 192 hours / 24 hours( 1 day) = 8!YOU SAVED me 8 days of my life!
My heros! 🙂
Many, many thanks do develop a simple/ease to use plugin to a “dummy tech” like me!

Really powerful, really useful

ALthough it no longer seems to be in development, you can get a lot done with this plugin. There are a few idiosyncracies to know about though. I wrote them up here:
https://wordpress.org/support/topic/additional-usage-notes/

With the idiosyncracies fixed, or with slightly improved documentation, this plugin would easily rate 5 stars. As it is, once you get used to the workarounds, you get 5-star functionality.

Read all 55 reviews

Contributors & Developers

“Search Regex” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Search Regex” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.4.16

  • Fix error thrown by regex options, props to leoxavier
  • Fix pagination problem

1.4.15

  • Minor refresh

1.4.14

  • WP 3.5 compat

1.4.13

  • Code cleanup

1.4.11

  • Add Arabic translation

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

  • WP 2.6

1.4.6

  • Added tag & sniplet searching.
  • Make work in Safari

1.4.5

  • Add search regex capabilities (‘search_regex_read’ and ‘search_regex_write’).
  • Fix meta values

1.4.4

  • Fix escaping issue
  • Allowing search limit and direction

1.4.3

  • Allow searching in pings & trackbacks

1.4.2

  • Fix escaping bug

1.4

  • Extensible plugins
  • Reorganisation of code

1.3

  • Use correct table prefix

1.2

  • Fix stupid typo

1.1

  • Minor cosmetic changes
  • Set a timeout limit