Rankmath Post Meta

#765266
  • Resolved Arik Shkol
    Rank Math free

    Hi, I’m working on updating my Rank Math focus keywords through the REST API. I attempted this using two methods:
    1. The Rank Math REST API v1/gethead/postmeta (or a similar endpoint).
    2. By modifying the PHP code to register Rank Math meta values.

    I successfully changed the focus keywords with both approaches. However, I’m facing an issue where the SEO score displayed on the individual page, which reflects the updated focus keyword, doesn’t match the score shown in the ‘all pages’ view, which still indicates the score of the previous focus keyword (even though it displays the new one).

    I’m aware that recalculating the SEO score via the Rank Math dashboard could resolve this discrepancy, but I’m looking for a way to automate this process. I aim to programmatically update the focus keyword and only accept those with a score above a certain threshold.

    Thank you for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thank you for reaching out with your concern about updating Rank Math focus keywords through the REST API and PHP code. I understand that you are facing an issue where the SEO score displayed on individual pages does not match the score shown in the ‘all pages’ view after updating the focus keyword.

    To address this issue and automate the process of recalculating the SEO scores after updating the focus keyword programmatically, you can utilize the Rank Math database tool to recalculate the SEO scores for all published posts where the focus keyword is set.

    Here are the steps to automate this process:

    1. Use the Rank Math database tool to recalculate SEO scores for all published posts with the updated focus keyword.
    2. Set a threshold for the SEO score, and only accept focus keywords with scores above this threshold.

    You can access the Recalculate Scores tool by following these steps:

    • Click on the Recalculate Scores option in Rank Math.
    • Allow Rank Math to recalculate the SEO scores for your published posts with the updated focus keyword.

    Recalculate SEO Scores

    Please note that the process may take some time depending on the number of posts on your website. Ensure to keep the browser open until the process completes.

    Once done, you should see a success message confirming that the recalculation of SEO scores is complete.

    Recalculating SEO Scores is complete

    By automating this process, you can ensure that the SEO scores reflect the updated focus keywords accurately across all pages.

    If you have any further questions or need assistance, please feel free to ask.

    Thank you for your understanding and patience!

    Sources:
    Rank Math Status and Tools » Rank Math
    How to Automate the Insertion of Focus Keyword » Rank Math
    How to Automate the Insertion of Focus Keyword » Rank Math
    Bulk Editing Options in the Rank Math SEO Plugin
    Analyzing Your Site’s SEO with Rank Math’s SEO Analysis Tool

    Hello,

    Thank you for contacting support.

    The calculation of the score doesn’t get triggered when the post is saved but rather during the period the post/page is open and it relies on JavaScript to make those calculations so the code you have to “re-generate” the score is not doing anything besides just saving the post.

    To trigger this, the only option is to either use the option to recalculate the SEO scores or open the posts/pages so the JavaScript runs and updates the SEO score accordingly which can then be saved by pressing the update button on the page.

    Don’t hesitate to get in touch if you have any other questions.

    can you explain to me how can i do
    this part?

    ‘posts/pages so the JavaScript runs and updates the SEO score accordingly which can then be saved by pressing the update button on the page.’

    Thank you!

    Hello,

    For the JavaScript to run you need to manually open the posts/pages and hit the update button. Besides that, the only other way to trigger this is by using the database tools to update the scores.

    This cannot be done programmatically from a custom plugin or custom code snippet like you are trying to do.

    Don’t hesitate to get in touch if you have any other questions.

    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.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Rankmath Post Meta’ is closed to new replies.