<?php
function high_hkd($text)
{
global $post;
$useragent = $_SERVER['HTTP_USER_AGENT'];
$google = "Googlebot";
$isgoogle = strpos($useragent, $google);
if ($isgoogle === false)
{
return $text;
}
else
{
$patterns[0] = '/ why /';
$patterns[1] = '/ but /';
$patterns[2] = '/ I /';
$patterns[3] = '/ is /';
$patterns[4] = '/ are /';
$patterns[5] = '/ about /';
$patterns[6] = '/ to /';
$patterns[7] = '/ of /';
$patterns[8] = '/ by /';
$patterns[9] = '/ the /';
$patterns[10] = '/ a /';
$patterns[12] = '/ posted /';
$patterns[13] = '/ from /';
$patterns[14] = '/ in /';
$patterns[15] = '/ if /';
$patterns[16] = '/ on /';
$patterns[17] = '/ and /';
$patterns[18] = '/ with /';
$patterns[19] = '/ for /';
$patterns[20] = '/ be /';
$text = preg_replace($patterns, ' ', $text);
return $text;
}
}
add_filter('the_content', 'high_hkd');
?> Google Bot Görmesin :)
0
●667
- 13-06-2008, 10:33:35Selam arkadaşlar. Wp için yazılmış olan bir eklenti var. Eklentiyi wpdestek sitesinden aldım. Bu eklenti googlebot'un belirlediğiniz kelimeleri index'ine almamasını sağlıyor. Şimdi phpcilere bir sorun var. Bu kod ile aynı mantıkta bir html kod olabilirmi ? Yada başka türlü html,js vs.. kodları ile istenilen kelimelerin indexlenmesi nasıl engellenebilir ?