Hello,
Thank you for getting in touch with us.
I am sorry but Rank math doesn’t have a feature to automate this. You can however modify the following filter to get the title of the post then assign it as the keyword for your posts:
/**
* Allow changing the meta keywords from the default Focus Keywords.
*
* @param string $keywords Keywords.
*/
add_filter( 'rank_math/frontend/keywords', function( $keywords ) {
return $keywords;
});
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Could you please help with the modification? I don’t know php. Thank you
Hello,
Please include your WP logins in the designated Sensitive Data section.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
I have added the code to my functions.php in my child theme. How do I check if its working. Will this set the keyword for older posts too?
“You can, however, modify the following filter to get the title of the post then assign it as the keyword for your posts:”
He asked me to modify the code he shared to before it does what I want. I was asking for help with the modification of the code. Do you still need account access to do that?
Hello,
You can try this code:
/**
* Allow changing the meta keywords from the default Focus Keywords.
*
* @param string $keywords Keywords.
*/
add_filter( 'rank_math/frontend/keywords', function( $keywords ) {
return the_title();
});
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.