REST API set yoast meta data
-
I was sent here from the general support forum by Juan G. a11n (@judagutor) for this question.
We are using the REST API to bulk add and update products with PHP using the code below (snipped for brevity)
How can we either update or set the yoast meta data? ie:_yoast_wpseo_metadesc$data = buildHomeData($h); $woocommerce->put('products/' . $h->prodid, $data); function buildHomeData($h) { global $debug; if (!isset($h->HomeType)) { var_dump($h); exit; } $shortdesc = "*** Short Desc ***"; $data = [ 'name' => $h->FacilityName, 'slug' => $h->slug, 'sku' => "".$h->id, 'description' => $h->Web_Notes, 'short_description' => $shortdesc, ]; return $data; }
Thanks for your help.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘REST API set yoast meta data’ is closed to new replies.