WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using <?php wp_tag_cloud(''); ?> to display tags on my website, how do I separate each tag with a comma but also remove the comma from the last tag?

share|improve this question
up vote 1 down vote accepted

According to the Wordpress Codex on tag clouds, you need to specify a comma as the "separator" argument.

$args = "separator"=>",";
share|improve this answer
where would I enter that though? – Joe Bobby Aug 19 '12 at 2:57
@JoeBobby If I understand what you want to do, you can create your own wordpress widget – fdsa Aug 19 '12 at 22:29
 Filter the seperator arg for the tag cloud function. Put the following in your theme's functions.php

 * Filter arguments of tag cloud widget to enlarge our text and
 * add commas
function myfunc_filter_tag_cloud($args) {
    $args['smallest'] = 18;
    $args['largest'] = 32;
    $args['unit'] = 'px';
    $args['separator']= ', ';
    return $args;
add_filter ( 'widget_tag_cloud_args', 'myfunc_filter_tag_cloud');
share|improve this answer
it didnt work could you paste in a code block? – Joe Bobby Aug 19 '12 at 2:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.