Hello,
Thank you for contacting Rank Math for advice on the effectiveness of optimizing your content with keywords.
The Rank Math SEO score is an internal scoring system to help you keep track of how well the SEO optimization of your content is. There are checks for keywords in your content, titles, image meta data, URLs as well as checks for basic content structure such as the presence of subheadings and minimum wordcount.
Using keywords does not guarantee high ranking and good SEO performance but they increase the chance that your content will rank higher. The best keywords contain the words/phrases used by visitors to find your website on Google.
Niche websites sometimes perform better because they usually have lower competition and higher quality content for their target niches than general websites.
The overall exposure of a website depends on how many people are searching for what they have. No matter how well the SEO is done, if a website is too niche nobody will be searching for what they have to offer.
Hope that helps. Please let us know if you have questions.
hi
thanks for the prompt reply
is it possible to assign the product title/blog post title automatically as the focus keyword?
thanks
Hello,
Yes, you can follow this guide to automatically generate focus keywords: https://rankmath.com/kb/how-to-automate-the-insertion-of-focus-keyword/
Hope that helps. Please let us know if you have questions.
Hi
I pasted the code into functions.php but i see the product posts keywords are still empty
only the blog posts keywords were set
any other solution?
thanks
I solved the issue by changing the post type to product
is there a code to add tags automatically as well?
thanks
Hello,
Adding product tags to the keywords is possible but we do not have a readymade code snippet for it. You will have to customize the code snippet provided in the article I linked. You can also refer to the following thread on how to retrieve product tags.
Hope that helps. Please let us know if you have questions.
hi
how to customize the code snippet for the function to happen?
i don’t want to risk adding some code that can do damage to my site
thanks
Hello,
Please refer to this function code instead:
function update_focus_keywords(){
$posts = get_posts(array(
'posts_per_page' => 100,
'post_type' => 'product' //replace post with the name of your post type
));
foreach ($posts as $p) {
$keywords = [];
if (get_the_terms($p->ID, 'product_tag')) {
foreach(get_the_terms($p->ID, 'product_tag') as $term) {
$keywords[] = strtolower($term->name);
}
update_post_meta($p->ID, 'rank_math_focus_keyword', implode(", ", array_unique($keywords)));
}
}
}
add_action('init', 'update_focus_keywords');
That code should help you automatically add product tags to your products as your focus keyword.
Hope that helps.
Thank you.
thanks Jeremy much appreciated !
Hello,
I am happy it helped you. Do you have any other questions or do you want us to mark this as solved?
Thank you.