Remove a particular tag name from the tagcloud

First: Don’t touch the core files, they will be overwritten during the next update.

There is already an argument for exclusions available: exclude. It expects a term id.

Sample:

wp_tag_cloud(
    array (
        'exclude' => 54
    )
);

Sometimes you don’t know the ID, but you can get it if you know the slug:

$args = array ();
$ex_term = get_term_by( 'slug', 'chattels', 'post_tag' );

if ( ! empty ( $ex_term ) && ! is_wp_error( $ex_term ) )
    $args['exclude'] = $ex_term->term_id;

wp_tag_cloud( $args );

See the Codex page for more parameters.

Leave a Comment