Title: populate yoast fields when adding data using REST API
Last modified: November 11, 2024

---

# populate yoast fields when adding data using REST API

 *  Resolved [ashishsharma0](https://wordpress.org/support/users/ashishsharma0/)
 * (@ashishsharma0)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/populate-yoast-fields-when-adding-data-using-rest-api/)
 * we basically use Yoast to define primary categories and consequently to generate
   canonical and og:url tags
   now we’re generating some articles programatically,
   but since yoast fields are not getting populated, canonical and og:url tags do
   not have a primary category and urls have uncategorised in them, is there a way
   to populate yoast fields while making POST api calls
 *     ```wp-block-code
       you can check <link rel="canonical"> hereview-source:https://news24online-com-preprod.go-vip.net/information/faridabad-weather-update-today-october-28-2024-current-temperature-aqi-imd-forecast-for-tomorrow-and-next-7-days-4/376194///my api request const articleData = {title: title,content: article,categories: selectedCategory ? selectedCategory : 292620, //addfeatured_media: imageUrl ? imageUrl : 362402, //addstatus: status,tags: tags,excerpt: excerpt,};const response = await fetch(postsUrl, {keepalive: true,method: "POST",headers: {...headers,Authorization: Basic ${<br><br>Buffer.from(<br><br>${auth.username}:${auth.password},<br><br>).toString("base64")<br><br>},},body: JSON.stringify(articleData),});const data = await response.json();
       ```
   
 * what can we do about this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpopulate-yoast-fields-when-adding-data-using-rest-api%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/populate-yoast-fields-when-adding-data-using-rest-api/#post-18133232)
 * Hello [@ashishsharma0](https://wordpress.org/support/users/ashishsharma0/)
 * Thanks for reaching out. There’s no feature in the plugin that accomplishes that
   but you may find some pointers in our [developer portal](https://developer.yoast.com/customization/apis/).

Viewing 1 replies (of 1 total)

The topic ‘populate yoast fields when adding data using REST API’ is closed to new
replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/populate-yoast-fields-when-adding-data-using-rest-api/#post-18133232)
 * Status: resolved