Yoast SEO
Importing into Yoast Meta fields (2 posts)

  1. dapezboy
    Posted 3 years ago #

    Alright, so I'm writing a script for the company I work for to take posts from an XML doc and put them into our WordPress build.
    I am able to get everything imported, except I cant figure out how to put them into Yoast's SEO for WordPress.

    I've tried:

    update_post_meta($postID, 'yoast_wpseo_focuskw', cleanACII($value->column[2])); // Add Yoast Keywords
    update_post_meta($postID, 'yoast_wpseo_metadesc', cleanACII($value->column[3])); // Add Yoast Meta Desc

    But that doesn't work, anyone know of a solution? or the proper meta_keys to use for yoast?


  2. Cristi_87
    Posted 3 years ago #

    Try to put "_" in front of the meta_keys. I've searched the rows the plugin added in db and it worked for me this way.

    update_post_meta($postID, '_yoast_wpseo_focuskw', cleanACII($value->column[2]));

    update_post_meta($postID, '_yoast_wpseo_metadesc', cleanACII($value->column[3]));

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.