According to the WordPress.com support page on short codes they are defined as follows:
A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut.
Many WordPress plug-ins make use of short codes to easily make a call to a plug-ins functionality. This can make maintaining your WordPress based site very easy but what happens if you decide to shift from one plug-in to another and that specific short code is not used in the new plug-in?
Let me give you an example. I used to use the WordPress Adsense Manager Plug-in on WindowsObserver.com to place my Google Adsense ads. It allowed me to build the ad and then use a short code to place it on a page or in a blog post. That short code looked something like this [ ad#post-top ].
I made the decision to go to a different ad source and the Adsense Manager plug-in was not compatible for me anymore. So what I decided to do initially was to just allow the Google Adsense ads to run on all of my old posts (at least 600 or so) and then run the new ad code on subsequent pages.
A couple of weeks ago I decided to do something about the old ad code and went in search of a tool to do this. That is when I found the Real-Time Find and Replace Plug-in written by Marios Alexandrou.
The premise of this plug-in is very simple. It searches for text you enter in the settings and dynamically replaces it as the page is generated in a users browser utilizing the alternate text that you provide.
Here is now simple it is to use:
Once you have installed the plug-in you will find the menu item for it under the Tools menu in your WordPress Admin panel:
Clicking on that brings up the main settings page:
Here you click the Add link and insert the text you want the plug-in to find and then insert the text you want put in its place in the Replace text box. Click Update to save your settings.
There it is – ready and able to find and replace any text you choose on the run. I used it to replace short codes but you could use it to replace anything you want to on your pages.
Final note about this plug-in: According to this plug-ins page at the WordPress.org Plug-in Directory it is only compatible up to version 2.8 however, I am running it on version 2.9.1 without any problem.
I would be very interested in hearing what plug-ins you use to find and replace text for your site/database.
I’ve been using Frank Bültge’s Search and Replace plugin for a while now. It allows you to specify what tables you want to search, rather than a global search and replace. It’s perfect if I only want to replace instances of a particular text in a post’s content, but not the title or the excerpt, for example.
Works well with WP 2.9.1.
http://wordpress.org/extend/pl.....d-replace/
This is great! I was wondering how I was going to get rid of the youtube embedding plugin, and replace it with proper embed code. I think this should do it!
Sounds like a very useful plugin as changes can be done on the fly. Here´s a related plugin for search and replace that I was aware of that might be worth looking into:
http://urbangiraffe.com/plugins/search-regex
Haven´t tried it myself though.
Hi, Just a note to say when I click on the Agent Press ad that it comes up as a broken link.
Otherwise, thank you for posting the information on WordPress that you do.
Semper Pax, Dr. Z
Sounds like a waste of resources to me. Why didn’t you just back up your DB and then run an SQL query to replace every instance of [theshortcode] with [thenewshortcode]? Simple, effective, and cleaner.
It’s not a very simple SQL query to replace a substring, is it? Especially if you want to do regex searching. I actually had to write a Perl script to do this instead.
But yeah, I agree with you – why would anyone want to add additional processing *every* time the page is loaded (or cache if it’s cached) for something that can be done once?
Okay, maybe it’s not super simple, but I still maintain that changing it on page load is…less than elegant.
This article is a real benefit for me and the scores of other WordPress users who aren’t familiar or comfortable with tinkering around with our databases. Not everyone knows how to run SQL queries or has the time to learn. Some of us don’t have time to learn. I know I don’t. I prefer the plugin method. Simple, effective and cleaner.
xoxo
I’d prefer to see a plugin that would make these changes permanent but, of course, allow previews and restoring in case something gets messed up.
*Makes note for future* 😉
I’m also a big fan of Frank B?ltge’s Search & Replace plugin. It helped me correct hundreds of words that got mangled when I moved my blog to a new host, owing to an error in the MySQL character set. (UTF8)
You change the text once and it stays changed.
In fact I was looking for another plugin and bumped into this. After reading your post I think I will give it a try. First I will test it on my localhost.
Thanks.