How to Hide WP OpenAPI Admin Menus

function plt_hide_wp_openapi_menus() {
	//Hide "Settings → WP OpenAPI".
	remove_submenu_page('options-general.php', 'wp-openapi-settings');

	//Hide "WP OpenAPI".
	remove_menu_page('wp-openapi');
	//Hide "WP OpenAPI → All".
	remove_submenu_page('wp-openapi', 'wp-openapi');
	//Hide "WP OpenAPI → oembed/1.0".
	remove_submenu_page('wp-openapi', 'wp-openapi/oembed/1.0');
	//Hide "WP OpenAPI → wp/v2".
	remove_submenu_page('wp-openapi', 'wp-openapi/wp/v2');
	//Hide "WP OpenAPI → wp-site-health/v1".
	remove_submenu_page('wp-openapi', 'wp-openapi/wp-site-health/v1');
	//Hide "WP OpenAPI → wp-block-editor/v1".
	remove_submenu_page('wp-openapi', 'wp-openapi/wp-block-editor/v1');
}

add_action('admin_menu', 'plt_hide_wp_openapi_menus', 11);

Where do I put this code?