Hello,
It is not an option inside the Rank Math settings, you can achieve it by using our API Hooks for developers.
A few days ago a shared on this thread a similar code that you could modify to fit your needs, this one:
function update_focus_keywords() {
$posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'product' // With this we get only the products (WooCommerce)
));
foreach($posts as $p){
$term = get_the_title($p); // With this we get the product title
update_post_meta($p->ID,'rank_math_focus_keyword',$term);
}
}
add_action( 'init', 'update_focus_keywords' );
Looking forward to help you.
-
This reply was modified 4 years, 6 months ago by Alberto.
Appreciate Alberto,
I am going to try this and reply back ASAP.
This worked for me. I have over 400 products and it worked. My question now:
Must I visit every page to update the Keyword and show the SEO score?
Will this still reflect online even if I don’t update every individual product?
Thanks!
Hello,
To answer your first question, yes, you will need to visit them since the score calculation needs to execute some Javascript files, that is why you will need to visit them.
But to answer your second question, yes, it will reflect online even not updating each product.
Looking forward to help you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.