https://wp-kama.ru/function/wp_tag_cloud
Задать формат
array и вывести как хочется.
Код из функции:
switch ( $args['format'] ) {
case 'array' :
$return =& $a;
break;
case 'list' :
/*
* Force role="list", as some browsers (sic: Safari 10) don't expose to assistive
* technologies the default role when the list is styled with `list-style: none`.
* Note: this is redundant but doesn't harm.
*/
$return = "<ul class='wp-tag-cloud' role='list'>\n\t<li>";
$return .= join( "</li>\n\t<li>", $a );
$return .= "</li>\n</ul>\n";
break;
default :
$return = join( $args['separator'], $a );
break;
}