API and Filter help

#602858
  • Resolved Anonymous
    Rank Math free

    Hello,

    I’d like to know how I can insert my focus keyword and meta description to my RankMath templates using the filters and API.

    My API will post the article I want with this code:

    post_data = {
    'title': clean_meta_title,
    'slug': focus_keyword,
    'content': html_final, # Assign your HTML content here
    'category': post_category, # Assign your category here
    'tags': post_tags, # Assign your tags here
    'status': 'publish',
    'meta': {
    'description': clean_meta_description,
    }
    }

    Is it possible for me to use the focus_keyword and clean_meta_description properties to be used for RankMath and automatically populate the two options in RankMath?

    Thanks

Viewing 1 replies (of 1 total)
  • Hello,

    Thanks for contacting us and sorry for the inconvenience caused.

    You can use the following meta keys to add the metadata using the API:

    rank_math_title
    rank_math_description
    rank_math_focus_keyword

    Please make sure that the meta keys are registered inside the postmeta table. You can learn how to register the meta key in this example here: https://wordpress.stackexchange.com/questions/380513/add-post-meta-fields-when-creating-a-post-using-wordpress-rest-api

    Hope this helps clarify the situation.

    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 1 replies (of 1 total)

The ticket ‘API and Filter help’ is closed to new replies.