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 callsyou can check <link rel="canonical"> here
view-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, //add
featured_media: imageUrl ? imageUrl : 362402, //add
status: 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 to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.