Replace by Referrer 1.0
The WordPress plugin “Replace by Referrer”, written by Charlie Evans, Sr. Developer at Netconcepts, was designed for a client who had advanced tracking capabilities in place but no way to utilize them. When prospect phone calls came in they wanted to know which search engine referred them. Additionally, they wanted to offer a different phone number displayed for each search engine. The Replace by Referrer plugin was developed to automatically replace defined text on pages and posts within content depending on search engine referrer.
If Google refers a visitor to your site, a custom phone number (specific to Google traffic) or a custom link (to a specific Google referred landing page) will be displayed to that visitor. The same technology can be applied to MSN (rebranded as Live Search), Yahoo, and all other search engines as well without having multiple pages for each search engine.
It is completely free and has been released as “open source” under the GPL license. So enjoy!
Features include:
- Allows you to replace specific text strings in pages and posts with search engine specific referrer content.
- Session identification specific to search engine. Replace by Referrer remembers which search engine the visitor came from throughout your entire site.
- And best of all, it’s FREE!
Installation instructions
- Upload replace_by_referrer.php to your wp-content/plugins directory.
- Activate the plugin.
- Go to Plugin Editor
- Click the “Replace by Referrer” file in the right hand column
- Scroll down to “// comment about this replacement” (See example below)
// comment about this replacement
'' => array(
'google' => 'google1',
'msn' => 'msn1',
'yahoo' => 'yahoo1',
'default' => 'default1',
)Replace google1, msn1, yahoo1, or default1 with any text string.
For Example:
// comment about this replacement
'' => array(
'google' => '1-888-207-1109',
'msn' => '<a href="https://www.netconcepts.com">netconcepts</a>',
'yahoo' => '<img src="https://www.example_image_URL.com" />',
'default' => 'This default text would appear in place of if the referrer is not Google, MSN, or Yahoo',
) - When you have everything configured, insert within a post or page where ever you want the specified text seen above to appear.
Note: In the example seen above, if Google were the referrer, would appear as “1-888-207-1109”, if MSN were the referrer, would appear as netconcepts, etc.
To-do
- Configure all the referrers and replacements via the WordPress options menu in the Admin, as opposed to hardcoded in the plugin.
- Modify the code so that you can serve the text string based on referring keyword, as opposed to referring by search engine.
Feedback?
Got a bug to report? Or an enhancement to recommend? Or perhaps even some code to submit for inclusion in the next release? Great! Share your feedback by commenting to this post.

Chapter 6:
Keyword Research
From the fundamentals of link building to the nuances of natural linking patterns, virality, and authority.
Related Posts
How to Have a Conversation with ChatGPT And Actually Get Results Worth Using
Ever felt like you’re only scratching the surface of what ChatGPT can do? You’re not alone. While most people settle for basic responses, power users have discovered how to unlock its hidden potential and transform their workflows in the process. On the surface, GPT-5 might seem like just another AI upgrade — a slightly smarter […]
Read More
Is Google’s AI Telling the Truth? Here’s How to Fact-Check It
In 2024, Google fundamentally changed how we search. Their AI Overviews now sit at the top of search results, essentially taking the old featured snippets concept and supercharging it with AI – or as Google puts it, providing “helpful summaries” of web content. But here’s the thing: these aren’t just summaries. They’re AI-generated interpretations that […]
Read More
Embrace Journaling, Tackle Tardiness, and Explore Our Energetic Echo
Here’s what I found inspirational, challenging, or just downright hilarious this week. What caught your eye? And, remember to check out this week’s great podcast episodes: Scaling a SaaS Company with Jason Morehouse “A crucial factor to business success is to find and take the personal path that works best for you.” — Jason Morehouse […]
Read More
