Hello,
I apologize for the inconvenience you are facing while trying to change the Focus Keyword in Rank Math using the REST API endpoint /wp-json/rankmath/v1/updateMeta
.
Unfortunately, the /wp-json/rankmath/v1/updateMeta
endpoint is not designed to update the Focus Keyword in Rank Math. This endpoint is used to update meta tags and not specifically for changing the Focus Keyword.
To change the Focus Keyword in Rank Math, you need to follow the instructions provided in our knowledge base articles. You can set the Focus Keyword manually in the Rank Math Metabox within your WordPress editor.
If you encounter any issues or need further assistance with changing the Focus Keyword, please provide more details about the problem you are facing, and we will be happy to assist you further.
Thank you for reaching out with your concern.
Sources:
Analyzing Your Site’s SEO with Rank Math’s SEO Analysis Tool
How to Enable Headless CMS Support in Rank Math? » Rank Math
How to Enter SEO Meta Title, Description, and Focus Keyword » Rank Math
How to Automate the Insertion of Focus Keyword » Rank Math
Why Can’t I Enter More Than 1 Focus Keyword in Post and Product Categories? » Rank Math
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Hello,
Thank you for contacting us and bringing your concern to our attention.
We save all our metadata on the post meta field. Please note that we don’t have any routes in the REST API from WordPress to update these fields so you would need to update them like you would for any other default postmeta
entry. The meta field for the focus keyword is: rank_math_focus_keyword
So, you can create your own custom REST API functions to update Rank Math fields in the post meta table. You can refer to the following article as an introduction: https://mklasen.com/updating-custom-post-meta-via-the-wordpress-rest-api/
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.