Loop of custom post type names

I don’t think there’s a way, in WP’s native features, to give a post type, itself, meta.

You can get post types in your code using get_post_types( $args, $output, $operator ).

$post_types = get_post_types( $args, $output, $operator );

https://codex.wordpress.org/Function_Reference/get_post_types

But the only way I can think of to exclude post types based on a mutual value/variable is by setting relevant post type settings when registering the post type‘ – e.g. 'publicly_queryable' => false.

https://codex.wordpress.org/Function_Reference/register_post_type

And then, you can use get_post_types() to find only the post types that have a particaulr value of, for example, publicly_queryable.

This may suffice for what you’re trying to do. There is no ‘post type meta` in WordPress to allow you to set a ‘shared label’ for the post types themselves.

If my fix above doesn’t suffice, then maybe this plugin will be a good place to start (or at least look at it’s code) –https://wordpress.org/plugins/wp-post-type-meta/.