Showing WP_Error message with admin_notice action hook
You can use function add_settings_error. More details can be found in the WordPress documentation. I have edited your previous answer to include that: function wpse_189722_limit_tag_words( $term, $taxonomy ) { if ($taxonomy === ‘post_tag’) { if ( count( preg_split( ‘/\s+/’, trim( $term ) ) ) > 2 ) { add_settings_error(‘term_too_many_words’, ‘term_too_many_words’, ‘Maximum of 2 words allowed, … Read more