My CPT is created using a plugin so i cannot edit the supports parameter to add support for custom fields.

I tried using this code however it doesn't work either

add_action('init', 'custom_child_init');
function custom_child_init() {
    add_theme_support( 'custom-fields' );

How do i enable the custom field meta box on the Edit Page screen for single custom post types?

1 Answer 1


Try with this. just change CPT with your post type.

function wpcodex_add_excerpt_support_for_cpt() {
    add_post_type_support( 'CPT', 'custom-fields' );
add_action( 'init', 'wpcodex_add_excerpt_support_for_cpt' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.