Real-Time Find and Replace for WordPress
This plugin allows you to dynamically (i.e. at the time when a page is generated) replace code and text from themes and other plugins with code and text of your choosing before a page is delivered to a user’s browser.
Because the find and replace happens in real-time no changes are needed to plugins or themes which means upgrades remain easy!
Here are some examples:
- Don’t like the “Category:” text that the Dagon Design Sitemap plugin puts in front of every category? Remove it!
- Annoyed by the link that Global Translator adds to every page? Remove it!
- Have you noticed that the Sociable plugin doesn’t correctly display the Twitter image? No problem, insert it!
- Don’t like the link that the Photodropper plugin inserts with every image? It’s out of there!
And remember, all of the above can be done WITHOUT modifying themes or plugin files so you’ll always be able to upgrade them without having to worry about losing custom edits.
First of all, the interface (shown below) is pretty straightforward. On the left is where you specify what to search for. On the right is what, if anything, you want to replace it with. And in the middle you can indicate whether you’re specifying a standard rule or a regular expression i.e. with pattern matching.
1. Have you ever noticed that Google is picking up multiple versions of your pages with different replytocom parameters? This can result in a lot of duplicate content. There are have been a bunch of suggestions on how to fix this including redirects, disallow entries in your robots.txt file, and dynamic parameter settings in Google Webmaster Tools. With the Real-Time Find and Replace plugin you can keep Google from finding these URLs entirely while still keeping the commenting functionality. Just add this rule:
?replytocom= replaced with #replytocom=
Pretty sweet, right? Now the duplicate URLs don’t even exist so you don’t have to block them and you won’t lose link equity.
Note: This solution works perfectly on this site with this theme. I haven’t tested it exhaustively with other themes so be sure to test our your comment form after implementing.
2. Sometimes I close comments on a page or post. I don’t like having the text that reads “Comments are closed”. I figure such a message is redundant since you can’t enter a comment. To remove this I use this regex rule:
/<p class=\"nocomments\">(\s)*Comments are closed.(\s)*<\/p>/
Note: With regex rules you to need to start and end with a forward slash.
3. I use the Author Bio Widget, but it spits out a tag I don’t use. I could modify the plugin to remove it, but that would mean that when I upgrade the plugin I’ll lose the code update I made. So instead I use this rule:
4. I want Gravatar support on this site in some areas, but I hate having the same unknown icon displayed for commenters that don’t have a Gravatar image and in my case that’s most of them. To keep Gravatar support on while also eliminating the image I use this regex rule:
As an added bonus, removing all of these Gravatar calls reduces page load time.
6. The Photodropper Plugin outputs a link to an external site for every image it adds to a post. I think this is excessive so I remove the link with this rule:
<a href="http://www.photodropper.com/photos/">photo</a> which is replaced with just "photo"
Note this technique of removing links from plugins works everywhere. I’ve used it for a bunch of plugins.
The pro version of this plugin includes some filtering options (querystring, referrer, and useragent) so you can better control when matching rules are executed.
You are required to buy one (1) license per facing domain. Additional installations on ‘localhost’ do not require a separate license.
Note: If you’ve previously donated, you’re entitled to a free copy of the pro version. Just let me know you’re interested.