KadirCeyhan adlı üyeden alıntı

function.php içine aşağı kodları yapıştır.

function replace_keywords_fn($where)
{
$KWs = array('KelimeBir', 'Kelimeİki');
$URLs = array('http://linkbir.com', 'http://linkiki.com');

$pattern = array();
$replacement = array();
for($i=0; $i {
$pattern2 = '/]*>(.*?)'.$KWs[$i].'(.*?)/';
if(preg_match($pattern2, $where))
continue;

$pattern[$i] = '/([ ][!$%&()*+,./:;=?@_{}-])('.$KWs[$i].')([ ][!$%&()*+,./:;=?@_{}-])/';
$replacement[$i] = '123';
}
return preg_replace($pattern, $replacement, $where, 1);
}
add_filter('content_save_pre','replace_keywords_fn');


Aşağıdaki gibi kelime ve urlleri düzenleyip ekledim ancak bir etkisi olmadı. Eğer olur ise bu kod süper olacak.
function replace_keywords_fn($where)
{
$KWs = array('Wildlands', 'Uplay');
$URLs = array('https://www.bozuktus.com/etiket/ghost-recon-wildlands/', 'https://www.bozuktus.com/uplay/');

$pattern = array();
$replacement = array();
for($i=0; $i {
$pattern2 = '/]*>(.*?)'.$KWs[$i].'(.*?)/';
if(preg_match($pattern2, $where))
continue;

$pattern[$i] = '/([ ][!$%&()*+,./:;=?@_{}-])('.$KWs[$i].')([ ][!$%&()*+,./:;=?@_{}-])/';
$replacement[$i] = '12'.$KWs[$i].'3';
}
return preg_replace($pattern, $replacement, $where, 1);
}
add_filter('content_save_pre','replace_keywords_fn');