Adding data to Yoast Meta Title/Description through WordPress Rest API

I have been trying to add data via WordPress Rest API to the Yoast fields of meta title/ description but it doesn’t seem to update it.

I have used the following code where I have passed the meta through the post array to the API. The post is created but the fields aren’t updated.

I have also removed the protection on these fields so that they can be updated via API. I have added this code in functions.php

Can anyone please tell me a way it can be achieved or what changes need to be made? Any help will be appreciated 🙂

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com