Display Custom Content to Search Engine Visitors!

With this code you can show a custom message or contet to your search-engine visitors. We will edit funcitons.php and any theme file you want to show your content to search engine vsitors. Let’s Begin…

Here is the code;

Backup and open your theme’s functions.php and insert this code into it.

<?php function search_engine_visitors() {

	$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;
} ?>

You can edit or add any search engine rules into $SE. After that your function is ready. Insert this code below where you want to show your custom content to visitors.

<?php if(function_exists('search_engine_visitors')) {
	if (search_engine_visitors()) {

		// INSERT YOUR CODE HERE

	}
} ?>

That’s All. Have a nice day!


Related posts:

If you enjoyed this post, make sure you subscribe to my RSS Feed
Comments are closed.
Highslide for Wordpress Plugin