Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Block Editor – Meta values not saved, meta changes to empty array on update

So, in my case, the answer was simple, though it took a long time to find. Just in case anyone else ever has this issue, here is what solved it for me:

I was calling the register_post_meta in a file that was only being included if is_admin() returns true (this is a plugin metabox conversion, so there are some admin-only assets being called, etc)

Long story short: meta fields were being registered in the block editor because is_admin() returns true, but when the request was sent to REST, is_admin() is false, so the meta fields were not being registered, and an empty array was returned.

Related Posts:

  1. Update post meta custom field using block editor
  2. How to break meta values into different items and avoid duplicates?
  3. Transition from (classical) serialized custom meta field to (gutenberg) rest enabled meta
  4. How to save a ToggleControl value in a meta field?
  5. Custom Meta Box not Saving in Posts with Gutenberg Editor
  6. How to wrap meta values seperated by comma in ? [closed]
  7. Run a check for multiple meta key values
  8. IF Custom field value equals ZERO
  9. Looping inside block return
  10. Set class if a meta value is set within post archive
  11. WordPress Blocks, setAttributes not saving
  12. Can’t set custom meta fields for a post
  13. Custom meta POST request fired twice when updating a post in Gutenberg
  14. Custom Field: Display only if a specific key is selected outside the loop
  15. WP Query Args – search by meta_key or title
  16. Saving multiple custom meta box fields
  17. get Custom field label (select/dropdown) on front end
  18. What is the best way to get a different post’s custom field/postmeta with js?
  19. Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
  20. How to get custom post meta using REST API
  21. What is “meta_input” parameter in wp_insert_post() used for?
  22. How to enable revisions for post meta data?
  23. Best way to programmatically remove a category/term from a post
  24. Using get_post_meta with new_to_publish
  25. Add metabox to document tab in gutenberg
  26. Can I count the number of users matching a value in a multiple value key?
  27. When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
  28. Auto sort the wp-admin post list by a meta key
  29. Storing meta fields multiple times OR once with multi dimensional array?
  30. extend Meta Box / Document Panel
  31. display specific custom fields
  32. Is there a hook / action that is triggered when adding or removing a post thumbnail?
  33. getEntityRecord without knowing the post type
  34. passing argument to get_template_part() or a better way to code
  35. Is it possible to store arrays in a custom field?
  36. Get updated meta data after save_post hook
  37. Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
  38. importing data from non-wordpress mysql db
  39. Assign/update the custom field value for all posts
  40. Order by custom field date with ASC order
  41. Transients vs CRON +Custom Fields: Caching Data Per Post
  42. Unable to save datetime custom meta field using update_post_meta() function
  43. Create custom field on post draft or publish?
  44. Ordering posts by anniversary using only day and month
  45. get_post_meta fields don’t show up on posts page
  46. copy attachments to another post type and change attachment url
  47. Cannot edit post meta fields with rest API
  48. ajax delete value from custom field array
  49. How to use pagination with get_post_meta
  50. Add a post meta key and value only if it does not exist on the post
  51. WP_query : meta_key with custom rule for specific value
  52. Move value of one custom field to another
  53. Order posts according to user defined order for meta values?
  54. Custom fields: In what order are they saved into the DB?
  55. Function to change meta value in database for each post
  56. Get a post_id where meta_value equals something in a serialized meta_value field
  57. Get aggregate list of all custom fields for entire blog
  58. Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
  59. How to display Meta Field Value?
  60. MySQL query to set wp_postmeta using term_taxonomy_id value
  61. How to Validate Post Meta type/extension (Video File Image File etc)
  62. trim custom field text value and show (…)
  63. using multiple meta_key and meta_value in query_posts
  64. How can I sort homepage by a meta value?
  65. Get specific custom field keys from a post and put into an array
  66. How do I use wp_query for WordPress search?
  67. Nav Menu – Add class based on meta keys
  68. MySQL Query that looks for post with Custom Field, then changes Category
  69. ACF: How to get the full field name (meta_key) by a field key?
  70. How to update a meta field of type array in Gutenberg
  71. Bulk remove post meta
  72. How to create html block to display extra information on woocommerce single product page
  73. How to create a Custom Meta Box with Name/Value Admin User Input Fields?
  74. filtering custom post types via meta data drop down
  75. How to add a new meta key and assign timestamp to posts
  76. If meta key exists in get posts function otherwise create it
  77. Filter by custom field (meta_key) using JSON API
  78. Print custom field in Query Loop block
  79. WordPress Rest API to call page data associate with custom meta
  80. Unsaved changes in metabox inputs not detected in the block editor
  81. Possible to add a meta field for css attribute to the editor Advanced panel?
  82. Read / Watch / Listen times – meta
  83. How do I Implement Atomic Update of Post Metadata?
  84. How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
  85. Add new image block, set default class name and update it using Javascript
  86. Hide custom meta data if empty
  87. How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
  88. What WordPress function to use to get meta value by using meta keys?
  89. How to create a shortcode to print specific values stored in a post meta array?
  90. Removing link ” from ” on meta_value in custom feilds
  91. Add custom field to all posts in specific post_type
  92. Button inside Custom Meta Box triggering the Update Button
  93. Why is my Custom Meta Box Field Inputs NOT saving?
  94. Get registered custom fields or post meta even if empty
  95. Displaying multiple URLs as custom field values
  96. How to load an assets based on custom field value?
  97. Custom WP_Query for WordPress Search Results with meta_query
  98. How can you include custom post meta in search without calling each key?
  99. Unique meta_key with array value vs repeated meta_key with single values
  100. Can I access a post meta field before the loop?
Categories custom-field Tags block-editor, custom-field, meta-value, post-meta
Execute JavaScript code when your custom block is inserted
Custom Gutenberg block with nested InnerBlocks renderAppender not displaying add button

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress