Title: Listing Categories
Last modified: August 18, 2016

---

# Listing Categories

 *  [cron](https://wordpress.org/support/users/cron/)
 * (@cron)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/listing-categories/)
 * I would like to be able to have a simple list of all the categories on the site
   in this sort of format.
 * Cat 1, Cat 2, Cat 3
 * I do not want them displayed as links and I would like to exclude the ‘Uncategorised’
   category. Is this possible. I have looked at <?php list_cats(); ?> and the <?
   php wp_list_cats(); ?> template tags but they are not waht I am looking for.
 * Any sugestions would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/listing-categories/#post-360767)
 * This should work for you.
    ` <?php  global $wpdb; $where = 'cat_ID > 1'; //exlcude
   Uncategorized  $orderby = 'cat_name';  $order = 'ASC';  $my_cats = '';
 * ` $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where
   ORDER BY $orderby $order");`
 * ` if ( count($categories) ) {
    foreach ( $categories as $category ) { if (empty(
   $my_cats)) $my_cats = $category->cat_name; else $my_cats .= ', ' . $category-
   >cat_name; } } echo $my_cats;  ?>
 *  Thread Starter [cron](https://wordpress.org/support/users/cron/)
 * (@cron)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/listing-categories/#post-360831)
 * Thanks alot Michael. I was looking for a template tag of something but this works
   great. I appreciate the help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Listing Categories’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [cron](https://wordpress.org/support/users/cron/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/listing-categories/#post-360831)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
