Inserting Post Using wp_insert_post. How to Fill Rank Math SEO Fields

#84596
  • Resolved Yasser
    Rank Math free

    I am inserting posts via an android app , using wp_insert_post function

    $post = array(
    ‘post_excerpt’ => “My_Test”,
    ‘comment_status’ => ‘open’,
    ‘post_content’ => $post_body,
    ‘post_name’ => $post_title,
    ‘post_status’ => ‘draft’,
    ‘post_title’ => $post_title,
    ‘post_type’ => ‘post’,
    ‘post_category’ => array(3634,154, $post_categories_array),
    ‘post_author’ => 1,
    ‘tags_input’ => $post_tags,
    ‘meta_input’ => array(
    ‘source’ => $source_name,
    )
    );
    $post_id = wp_insert_post($post);

    My question is how can i insert title , description and other seo data with wp_insert_post

    Thank you

Viewing 1 replies (of 1 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Rank Math stores the SEO post metadata inside custom meta fields, so you will need to save that SEO data in the meta fields like:

    rank_math_title or rank_math_description

    Looking forward to helping you. Thank you.

    ​​​​​​​

    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 ‘Inserting Post Using wp_insert_post. How to Fill Rank Math SEO Fields’ is closed to new replies.