Easily Edit Multiple WordPress Posts with Search Regex

·


This website has been running on WordPress since the beginning and back then it was very new to me. I didn’t have a lot of knowledge in creating dynamic websites, PHP, hosting and etc because I was more involved with fixing computers, managing networks and servers. WordPress has tons of free themes and plugins whereby if you are not careful, you will end up installing a lot of unnecessary plugins which can cause conflicts and slow downs that can lead to crashing Apache.

There is a plugin that tags Technorati which I have been using for a very long time and I find it unnecessary now. Actually I don’t even know what it does because I simply followed the crowd since a few popular blogs used it. Deactivating and uninstalling the plugin is real easy but there are hundreds of posts which contains the tag [tags]tag1, tag2, tag3, tag4[/tags] at the bottom which I have to remove. Editing the posts one by one to remove the tags is a very time consuming and tedious task. Fortunately there is an easier way to search and replace in all post content using a plugin called Search Regex.


There are two methods to search using the Search Regex plugin. The first one is an exact search which is useful in changing characters or words that are static. For example I want to point all images URL from my website to CDN which is from www.raymond.cc/images/ to cdn.raymond.cc/images/. All I need to do is specify www.raymond.cc/images/ as the search pattern and cdn.raymond.cc/images/ as the replace pattern. Clicking the Replace & Save button will automatically make the changes on all post content.

To be on the safe side, it is better to click on the Search button first to verify if you have specified the correct search pattern. The Search button will only search but won’t replace or change anything.

Deleting the tags from the posts will require the use Regular Expressions since the tags are all different words are not static. As far as I know, the tags starts with [tags] and ends with [/tags]. After a little trial and error with Expresso, I managed to find the correct Regex which will highlight all the tags.

Select the source as Post Content, specify the Search Pattern as ^\[tags\].*\]^ and leave the Replace Pattern as blank. Click the Replace & Save button, the tags are automatically removed from hundreds of posts.

Search Regex

This plugin makes changes directly to the database so if you’re not sure what you’re doing, always use the Search button to verify if you’re searching the correct pattern. It is also good to backup the database so that you can restore it if sometimes goes terribly wrong. After finished using Search Regex, you can go ahead to deactivate and uninstall the plugin as there is no reason to keep it active all the time.

[ Search Regex WordPress Plugin ]

Related posts:

  • PeerSpider – easily search multiple bittorrent p2p sites
  • Search Multiple Search Engine At The Same Time
  • Easily Delete or Replace Multiple Lines for All Files in a Folder
  • Easily Delete All WordPress Spam Comments Using phpMyAdmin
  • Search a Particular Word in Multiple Editable Text Files