How to remove the old “Custom CSS” from customizer after the theme has been migrated to Gutenberg FSE

The CSS is stored in the Custom Post Type ‘custom_css’ and there will be reference to it serialized in the options table with the option_name ‘theme_mods_yourthemename’ and it will look something like this:

s:18:"custom_css_post_id";i:85;

The “85” in this example is the post ID of the custom_css post.

An action will remove the CSS option from the customizer. So you could search for “$wp_customize->remove_section” to find that in your code to reverse the hiding. (WordPress Code Reference)

function remove_css_customizer() { 
  $wp_customize->remove_section( 'custom_css' );
}

add_action( 'customize_register', 'some_function_name' );