Yazı başlıkların Rank Math SEO'da otomatik odak kelime olmasını istiyorum.
Ücretli/ücretsiz destek olacak arkadaşlar iletişime geçebilir
Rank Math Otomatik Odak Kelime Destek
4
●216
- 19-10-2023, 18:44:56Hocam Onu yapmıştım ancak olmuyor.4irlines adlı üyeden alıntı: mesajı görüntüle
rank-math.php dosyasını oluşturunca admin paneli ve ana sayfanın en üstünde bu hata çıkıyor.

functions.php 'nin en altına eklediğimde ise; admin paneli çöküyor - 04-12-2023, 14:08:00functions.php içerisine eklenecek her halukarda.
1- SADECE aşağıdaki kodu ekleyin. Eski yüklenen makalelerdeki başlıkları focus anahtar kelime yapacaktır.
/**
* Function to automatically update the focus keyword with the post title, if no focus keyword is set
*/
function update_focus_keywords() {
$posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'post' // Replace post with the name of your post type
));
foreach($posts as $p){
// Checks if Rank Math keyword already exists and only updates if it doesn't have it
$rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );
if ( ! $rank_math_keyword ){
update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_t itle($p->ID)));
}
}
}
add_action( 'init', 'update_focus_keywords' );
2- functions .php içerisine eklediğiniz 1. maddedeki kodu silin aşağıdaki kodu ekleyin. Publsh ( direk yayınla olarak ) eklediğiniz makaleler otomatik olarak başlık ney ise focus anahtar kelımede o olacaktır. 2 kod aynı anda çalışmaz sistem çöker.
/**
* Function to automatically update the focus keyword with the post title
*/
function update_focus_keywords()
{
$posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'post' //replace post with the name of your post type
));
foreach ($posts as $p) {
update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));
}
}
add_action('init', 'update_focus_keywords'); - 04-12-2023, 14:13:22Merhabalar,
Ücretli destek almak isterseniz bana ulaşabilirsiniz.
Whatsapp: https://wa.me/+905426800594
