Support

Account

Home Forums ACF PRO Changing custom fields from page to custom post type Reply To: Changing custom fields from page to custom post type

  • Hi @mattrobinson

    Hmm… The easiest way would be to write a PHP script to transfer the values from the old post the new post. The code would be something like this:

    
    $field_key = '<field_key>'; // replace this with the actual field key
    $old_post_id = <old_post_id>; // replace this with old post id
    $new_post_id = <new_post_id>; // replace with new post id
    
    // first get value from the old post
    $value = get_field($field_key, $old_post_id);
    
    update_field($field_key, $value, $new_post_id); 

    Hope this helps 🙂