How to display tag cloud without links

We can modify the output with the filters wp_tag_cloud or wp_generate_tag_cloud.

But we could also use:

echo strip_tags(
    wp_tag_cloud( 'echo=0&smallest=10&largest=10&number=0&format=list' ),
    '<ul><li>'
); 

where we strip all the HTML tags from the output, except the ul and li tags.

Notice that we added the echo=0 parameter as mentioned in the Codex as a way to return the output. We could also have used echo= because it has to full fill the condition:

if ( 'array' == $args['format'] || empty($args['echo']) )

to return the output. So empty( null ) and empty( '' ) is true but it’s strange that empty( 0 ) is also true, but that’s just how the empty() function works 😉

The wp_tag_cloud() function has the link parameter, but it only has the possible values as view or edit. It would be nice to have the none option, to disable links and show only the text.