How To Display Google AdSense Advertisements To Only Search Engine Visitors On WordPress

AdSense Advertisements For Search Engine Traffic

During the process of monetizing a WordPress blog or website many webmasters (owners, admins, whomever) take a tactical approach in order to leverage earnings by strategically placing Google AdSense advertisements which are only visible to organic search engine traffic (opposed to all visitors). Many bloggers and webmasters acknowledge that organic visitors from Google are more likely to click and respond to Google AdSense advertisements.

Besides displaying advertisements for only incoming search traffic, there are many valuable procedures which can be accompanied by displaying ads for search engine traffic in order to keep website readers and visitors satisfied.  Keep in mind that sometimes too many advertisements can be a bad thing, in this case using our supplied snippet below can keep your direct and referred traffic happy whilst providing advertisements for visitors whom are statistically more likely to click the advertisements. The snippet can also be used to maintain the amounts of advertisements on your website, keeping ads organized, and only displaying AdSense when necessary.

There are many WordPress plugins and essentially different ways to display Google AdSense ads for search engine traffic only, but we find using a simple PHP function supplied by Scratch99 is better for performance, and advertisements can strategically be placed anywhere without the limitation some plugins possess.

Display AdSense To Search Engine Traffic Only

Google AdSense Advertisement Examples

How to display advertisements to only organic visitors

Down Copy and paste the snippet below into your functions.php file
[Normal_Box]

function scratch99_fromasearchengine(){ $ref = $_SERVER['HTTP_REFERER']; $SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.'); foreach ($SE as $source) { if (strpos($ref,$source)!==false) return true; } return false; }

[/Normal_Box]

Down Copy and paste the snippet below wherever you wish to display your advertisements

Replace INSERT ADSENSE CODE HERE with an individual Google AdSense code
[Normal_Box]

[/Normal_Box]

if (function_exists('scratch99_fromasearchengine')) {
  if (scratch99_fromasearchengine()) {
    INSERT ADSENSE CODE HERE
  }
}

Sean Doyle

Sean is a distinguished tech author and entrepreneur with over 20 years of extensive experience in cybersecurity, privacy, malware, Google Analytics, online marketing, and various other tech domains. His expertise and contributions to the industry have been recognized in numerous esteemed publications. Sean is widely acclaimed for his sharp intellect and innovative insights, solidifying his reputation as a leading figure in the tech community. His work not only advances the field but also helps businesses and individuals navigate the complexities of the digital world.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.