By Marios Alexandrou on March 27, 2023.
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:
And remember, all of the above can be done WITHOUT modifying theme 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, useragent, and post type) so you can better control when matching rules are executed. There's also a description field to help you manage your many rules.
Before you buy, please note that: