How trigger to save post when updating post meta
I have very confused situation. I have added posts and all posts metas from one website db to another one, everything is fine, images, title, description of posts are there.
But post metas are not showing on webpage(img1), although they are exists when I go to post edit page in wp-admin(img2), I can see the post data , but they are not showing until I click to 'Update'
button myself.
After that all post data is showing.(img3,img4)
Posts are to much (about 4000 recipes) , so I can't do it manually, it will take a long time.
So I need something to trigger every post updating automatically.
I have tried to update post meta, but it doesn't work, it still have to update post manually.
$metas = get_post_meta(get_the_ID());
foreach($metas as $meta_key = $meta_value){
foreach( $meta_value as $val ){
update_post_meta( get_the_ID(), $meta_key, $val);
}
}
Is there a way to do that?
Topic wp-update-post post-meta Wordpress
Category Web