Post meta data not showing in frontend, until hitting 'update' button

by rhyno183   Last Updated September 21, 2018 15:08 PM

I try to insert around 2000 video-posts into WP. There is a custom field in the theme for the video-url, so I add the video-url to the post meta data with the corresponding field name. ACF seems not to be used by this theme (Edge, Journo).

This meta data shows up correctly in that field in the backend, however not in the frontend until I hit the update button for every post. After hitting the update button, everything works perfectly.

I tried so far:

  • wp_insert_post with a postarr containing 'meta_input'
  • wp_insert_post followed by add_post_meta
  • additional update_post_meta
  • additional wp_update_post
  • additional update_field
  • different versions of creating the post as a draft and then use wp_publish_post at different times

Does anyone know which functions excactly are triggered by the update button? Or other ideas?

Thanks in advance!

Answers 1

Thanks for your answers! Maybe I was a bit unclear, but I don't use ACF, it is just a field that comes with the theme.

However, this question and answers helped to find the problem:

My WP metadata table entry was incomplete after creating a post programatically, the theme required another field. Saving the post again through the UI fixed that.

Using a plugin to display the meta data I compared the post's meta data after inserting the post and after hitting the update button, so I identified the missing value in the meta data..!

Hope this helps also for others with a similar issue!

September 24, 2018 19:40 PM

Related Questions

Posting to list item with OptionTree

Updated October 31, 2017 13:08 PM

Custom post type meta box field won't save

Updated September 06, 2017 18:08 PM

Hook after post was created to update Custom Fields

Updated November 03, 2017 15:08 PM