Code to “nofollow” Specific WordPress Post

/* NoFollow Specific WordPress Post */
add_action('wp_head', 'wpflt_header_function_condition_nofollow_post_single');
function wpflt_header_function_condition_nofollow_post_single(){
if ( is_single( '1889' ) ) { ?>
<meta name="robots" content="nofollow" />
<?php }
};

Here is a simple filter to add ‘nofollow’ metatag to specific post in WordPress. Enter post ID of the specific post in Line 4. Confirm the tag in the Source Code.