Code to “noindex” Multiple Categories in WordPress

/* No Index Multiple Categories */
add_action('wp_head', 'wpflt_header_function_condition_noindex_multiple_categories');
function wpflt_header_function_condition_noindex_multiple_categories(){
if ( is_category( array( '12', '13' ) ) ) { ?>
<meta name="robots" content="noindex" />
<?php }
};

This code will disable indexing of multiple category pages in WordPress by adding ‘noindex’ tag to the head of each category page. Please enter the right category IDs in Line 4.