I have some custom post types and inside them I have some custom fields that I need to convert in post content.
Is this possible? How can I do this?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can do this by using something similar
<?php //Post we need to update $id = 37; $custom_field = get_post_meta( $id, 'custom_field_key', true ); // Update post 37 $mg_post = array( 'ID' => $id, 'post_content' => $custom_field, ); // Update the post into the database wp_update_post( $mg_post ); //Delete the custom field delete_post_meta( $id, 'custom_field_key' ); ?>
Hope you got the idea. Let me know what have you tried.