How to use automation tools to update Focus Keyword, Permalink and Description

#1018020
  • Resolved Kyle Rolfson
    Rank Math free

    I am using the n8n automation platform and I want to be able to automatically post, update and get the Focus Keyword, Permalink and Descriptions for each WordPress Post. Is there a way to do this with a Rank Math REST API or WordPress REST API so I don’t have to manually copy, past and edit them to get a ranking? If so is there any documentation on how to do this? Thank you!

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

    Thank you for contacting Rank Math and bringing your concern to our attention.

    We save all our metadata in 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 post meta entry. The meta fields are:

    rank_math_title
    rank_math_description
    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/

    Looking forward to helping you.

    Kyle Rolfson
    Rank Math free

    I’m working on integrating with RankMath SEO via the WordPress REST API. I need comprehensive documentation on where RankMath stores its data in the WordPress database (which meta keys, option names, and tables are used), so I can properly read and update this data through the WordPress REST API. Specifically, I’d like to know the complete list of meta fields beyond the basic ones (rank_math_title, rank_math_description, rank_math_focus_keyword) and how they’re structured. Per my knowledge accessing the RankMath API doesn’t allow editing of the WordPress fields so I have to register these fields in order for the WordPress REST API to send those fields and data to me via an API call.

    1). At a minimum to continue my development I need the table and field name for where the “Permalink” data is stored in the WordPress data base. It shows this field in the Preview Snippet Editor.

    2). Where is the post SEO Score stored in the WordPress database? (Ex: 85/100)

    3). Where is the “Title” character and pixel count stored in the WordPress database? (Ex: x/60 (x/580px) These values show in the Preview Snippet Editor.

    4). Where is the “Permalink” character count stored in the WordPress database? (Ex: x/75) These values show in the Preview Snippet Editor.

    5). Where is the “Description” character and pixel count stored in the WordPress database? (Ex: x/160 (x/920px) These values show in the Preview Snippet Editor.

    Why has this not been responded two in almost 5 days?

    Hello,

    Sorry for the delay in reply.

    We currently don’t have a documentation on where Rank Math stores the meta in the database, since we don’t have a dedicated API for changing the meta information. You’ll have to create your own REST API and have the Rank Math meta update using simply the update_meta() function.

    All Rank Math meta data is stored in the wp_postmeta table with the same prefix like so: rank_math_*.

    Some meta are stored with serialized data, so you’ll have to account for that as well.

    1. Rank Math doesn’t store the permalink in the database as the plugin solely uses the standard permalink from WordPress. This is also why you can’t change the user or author’s permalink via Rank Math.

    2. The meta name where we store the SEO score is rank_math_seo_score

    3., 4. and 5. We don’t store the character count or the pixel length. We compute that as you open the SEO metabox. You’ll have to create your own script to compute such information.

    Hope that helps.

    Thank you I will go based off of this.

    Hello,

    We are glad we could address your concern.

    Please feel free to create a new forum topic if you do have another question in the future.

    It will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘How to use automation tools to update Focus Keyword, Permalink and Description’ is closed to new replies.