You need to register your meta field first, then you can insert / update it into a post using rest api. https://codex.wordpress.org/Function_Reference/register_meta
$object_type="post";
$args1 = array(
'type' => 'string',
'description' => 'My Meta Key Description',
'single' => true,
'show_in_rest' => true,
);
register_meta( $object_type, 'MyMetaKey', $args1 );
Hope it helps
Related Posts:
- Best way to programmatically remove a category/term from a post
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- Cannot edit post meta fields with rest API
- Login WP – Connect single field to an external api
- Buik update custom field values from external API
- How To Save Data From Remote APIs To ACF?
- WordPress Rest API custom field not updating till i manually update the post
- Custom pages or Custom Posts
- Retrieve Google API JSON data and store as WordPress Custom Fields
- How to add a custom field in the advanced menu properties?
- Underscores in custom fields
- Sortable Custom Columns in User Panel (users.php)?
- Add custom field to the archive page?
- Need small coding with Custom Fields Search
- Adding Custom Field to Taxonomy Input :Panel
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to store the value of a custom field dropdown select for post referencing?
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- Add meta data to the menu
- Custom bulk action for media gallery items
- Order Custom post type loop by custom field (datepicker)
- Localized Date Format for Custom Field
- Check if the value of a field has changed on save_post
- Saving custom image meta fields
- Echo values from custom field outside loop php
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Complex WP_User_Query call fails on production server
- Query post order by post and desc not working
- If category then echo a custom fields
- Custom field as meta description
- post meta getting deleted on save
- Auto Populate Custom Field with Complex Value That Increase by One?
- Display custom field if it exists and has a specific value [closed]
- Checkboxes in registration form
- Displaying a checkbox array from advanced custom field
- Display custom field values from posts on frontpage
- WordPress: custom field display twice
- meta_compare seems to be treating values as strings instead of integers as expected
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- How to add fetchpriority parameter to images in the media library?
- Calling the “wp-link-wrap” pop-up modal
- Editable custom field in WP Admin Dashboard
- How do I add an image upload, custom field to a WooCommerce product?
- Customizing user data
- displaying and sorting comments by a custom field (using PODS plugin) [closed]
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Custom tables or custom fields?
- Show user info in a hovercard [closed]
- WP Query – Is this correct?
- Shortcode To Display Post Custom Field Value in Post Title, Post Content
- edit_tag_form_fields is depricated but tag_edit_form_fields doesn’t work
- Iterate through users and display users meta info at front-page
- Getting the Featured image URL and inserting it as Custom Field on Post update / publish
- Adding custom field and querying from post table
- How to display a product features dynamically with icons?
- Access ACF fields within custom preview function?
- Update custom field values on edit address page woocommerce
- Can I access Posts of custom-fields via URL?
- Is there a (sane) way to get all custom fields for a post, which do not have a leading underscore?
- Custom field image to Featured Image
- Show array of meta_value in Edit Post Coloum
- plugin-list-category-post custom fields
- custom filed from post in the side bar
- Working with multiple values and metaboxes
- Unable to select image with custom field
- How to automatically change a posts status to draft based on custom field
- Rewrite comment form post ID on submit
- How to show ACF fields in Gridbuilder custom block
- Move the metaboxes to the very top of post editor
- search based on custom field
- Why isn’t update_post_meta saving?
- Custom Fields not working properly
- Custom fields multiple commas separated values
- Display taxonomy loop using custom field data
- How do I display a custom field in an existing form on the front end?
- Add custom field information to source meta data
- use mysql to replace one custom field value with another custom field value
- Change blog post title on main blog page
- Spit out list of distinct instances of custom field?
- How to save array option as text and not integer?
- Delete custom meta
- Display custom fields only if it has a value
- Add nofollow to custom field link and make domain exceptions?
- Filter and display a specific custom field value [closed]
- wordpress simple post multi rating with post_meta and user_meta
- Custom fields are not displaying in page with multiple loops
- Add class from custom field into widget class
- Get multiple posts with some custom fields efficient
- Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data
- Meta boxes not displayed, data isn’t being saved
- Custom fields / meta box output
- Get single image from custom fields made with WCK custom fields creator
- Media Custom Fields – get a value with PHP
- How to add google map to custom field
- jaredatch metaboxes on video post formats
- How can i put a custom field inside this php
- Dynamically update Custom Fields to display new dates
- save all acf options in one meta_value [closed]
- Can running a WP-Cron to update_post_meta cause performance issues?
- custom field value is blank or empty