importing data from external api

#637665
  • Resolved Anonymous
    Rank Math free

    importing data from external api, and setting rank math title and description, what is the field name in which I should map the data in the api

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

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

    Most likely you’re looking for Headless CMS support if I’m not wrong.

    If so, please follow the guide below to learn how you can enable Headless CMS Support with Rank Math:
    https://rankmath.com/kb/headless-cms-support/

    And here are the meta key we use to save the title and description for RanK Math:

    rank_math_title
    rank_math_description

    Hope that helps.

    Thank you.

    Anonymous
    Rank Math free

    Hi will this work with wp_insert_post parameters or with update fields for acf,

    eg –
    ‘post_title’ => $title,
    ‘post_excerpt’ => $excerpt,
    ‘post_name’ => $slug,
    ‘post_type’ => ‘post’,
    ‘post_status’ => ‘publish’,
    ‘post_content’ => ”,
    ‘post_date’ => $created_date,
    ‘post_modified’ => $updated_date,
    ‘rank_math_title’ => $metaTitle,
    ‘rank_math_description’ => $metaDescription

    or
    update_field(‘rank_math_title’, $metaTitle, $post_id);
    update_field(‘rank_math_description’, $metaDescription, $post_id);

    Hello,

    The wp_insert_post function will only save the details to wp_posts table whereas our metas need to be saved to wp_postmeta table. Please make sure you have added those meta fields as an array in your wp_insert_post arguments.

    If that doesn’t work, you would need to insert the data to the Rank Math meta using this function called update_post_meta. Just make sure that you have retrieved the post ID after calling the wp_insert_post function so you can use it for the update_post_meta function.

    Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.

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

The ticket ‘importing data from external api’ is closed to new replies.