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

Meta value does not save for scheduled posts

I had a similar problem with a custom metabox. The problem was the use of $post_id inside the save-function. Using global $post and then $post->ID solved the problem for me.

function save_metabox(){
    global $post;

    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){
        return $post->ID;
    }

    $myData = $_POST['my data'];
    update_post_meta($post->ID;, $myData);
}

Related Posts:

  1. How can I retrieve multiple get_post_meta values efficiently?
  2. How to batch update post content with custom post meta value
  3. Using radio button meta data from a custom meta box
  4. How to I retrieve the ID from the Posts page?
  5. How to save meta checkbox WordPress
  6. Updating post meta for checkbox
  7. How can I tell if a post has been published at least once?
  8. Adding a meta box to determine the sidebar [closed]
  9. Simple Custom Metabox Not Saving
  10. How to check if post meta key exists or not in wordpress database
  11. How to add category to: ‘wp-admin/post-new.php’?
  12. Code to make a post sticky
  13. How to allow hidden custom fields to be added from wp-admin/post.php?
  14. Can I force a metabox to be in one column?
  15. How to add a new tab to page editor
  16. Listen to Post action
  17. Export WordPress Posts and Meta Information in CSV format
  18. Delete duplicated wp_postmeta record
  19. How to add metabox for post of specific category
  20. Will a large postmeta table slow a site down?
  21. Update all posts automatically when using post_meta
  22. upload image in a meta box
  23. Change slug with custom field
  24. Better post meta efficiency?
  25. Setting post meta data to random value during post status transition / on publish
  26. meta_box or custom_field as a second tinymce post-instance?
  27. Edit meta data does’t work with custom sql
  28. 1 column admin screen options – move submitdiv to bottom
  29. multicheck box for post metabox
  30. Create A Metabox For A Custom Field
  31. Human Time Diff, change mins to minutes
  32. Change post format using custom field
  33. Have save_post write to database image meta [closed]
  34. Does WP get all post_meta on POST page?
  35. Sanitizing `wp_editor();` Values for Database, Edit, and Display
  36. What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
  37. Exporting Data from WordPress into a flat table
  38. Adding Multiple Values to a Post Meta Key
  39. Save list from a custom meta box?
  40. Using Custom Posts with Metaboxes and Drop-downs
  41. PHP Notice error (when on 404 page)
  42. What Is meta_id In wp_postmeta?
  43. Checking if a post with certain meta value exists
  44. How to permanently delete a post meta entry?
  45. Add custom field automatically (add_post_meta) with value based on number of words of article
  46. Automatic value for custom fields for posts
  47. How to generate numbers indistinguishable for the IDs of the posts
  48. Modify WP_Post before processing
  49. How to rename “Publish” metabox title in post screen
  50. Understanding and using metaboxes in posts
  51. Save re-arranged draggable post items to wordpress database
  52. I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
  53. Change post_date to post_modified date on post template?
  54. Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
  55. Dashboard :10 Last draft page and 10 last pending review page (metabox)
  56. How can I sort posts by the date and a custom meta field?
  57. is there a way to show the the post title after the image?
  58. Get Meta Key Value While Saving Post
  59. Adding custom fields to bbpress reply form
  60. Force the “Choose from the most used tags” meta box section to always be expanded
  61. Custom Posts Query and meta_query Sort Order
  62. How to compare two posts including their meta fields on a scalable base?
  63. Getting value from get_post_custom
  64. Calling Different Custom Post Timestamps in a table
  65. Simultaneous admin updates causes custom fields to not update
  66. Is it possible to paste a link without tags and make it directly a link in a post?
  67. Cannot retrieve a custom RSS field from posts
  68. Saving custom fields to a custom taxonomy
  69. How to automate featured posts number? [duplicate]
  70. Customize rel=canonical tag for single blog post
  71. Change all author links in Blog roll
  72. How to calculate the average of a post meta value(Numeric) of a specific author
  73. Is there any way to tell when wp_postmeta has been updated?
  74. Hide custom metabox value from custom fields
  75. Is there a way to create a meta box that can be added multiple times to a post dynamically?
  76. Get post meta retrieving wrong value
  77. wpColorPicker – problem with implementation to post meta
  78. Upload attachment from external site
  79. Change post author without using wp_update_post()
  80. Show metabox value last post excerpt, title and link
  81. if in category but only with post meta
  82. wp_query with ajax
  83. Update post meta within save_post action
  84. Display post number by category
  85. Saving Post Data in Another Database
  86. Custom permalink for each post
  87. Is there a way getting post fields using `transition_post_status`
  88. Automatic blog page with custom design [closed]
  89. Add multiple meta keys to a post at once
  90. Show number of posts by logged in user
  91. How does WP decide how to display a page
  92. Adding JS functionality to the Publish button in wp-admin/post.php
  93. When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
  94. Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
  95. Get post related to particular meta box? [closed]
  96. Insert data from custom created PHP page into wp_postmeta table
  97. The loop starting at a certain ID
  98. saving/reading custom field value does not work – no value gets POSTed
  99. Get post category as a separate string and url
  100. Why my meta boxes won’t show in front post page?
Categories posts Tags metabox, post-meta, posts
education system [closed]
How to wrap the list with custom class using wp_nav_menu?

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