Title: category_description
Published: April 25, 2014
Last modified: April 28, 2025

---

# category_description( int $category ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#wp--skip-link--target)

Retrieves category description.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#parameters)󠁿

 `$category`intoptional

Category ID. Defaults to the current category ID.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#return)󠁿

 string Category description, if available.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#more-information)󠁿

If used in the archive.php template, place this function within the [is_category()](https://developer.wordpress.org/reference/functions/is_category/)
conditional statement.

Otherwise, this function will stop the processing of the page for monthly and other
archive pages.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#source)󠁿

    ```php
    function category_description( $category = 0 ) {
    	return term_description( $category );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/category-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/category-template.php#L288)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/category-template.php#L288-L290)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#related)󠁿

| Uses | Description | 
| [term_description()](https://developer.wordpress.org/reference/functions/term_description/)`wp-includes/category-template.php` |

Retrieves term description.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.0.0](https://developer.wordpress.org/reference/since/1.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#comment-content-1236)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/category_description/#comment-1236)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1236)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1236)
 4.  **Default Usage**
 5.  Displays the description of a category, given its id, by echoing the return value
     of the tag. If no category given and used on a category page, it returns the description
     of the current category.
 6.      ```php
          <div><?php echo category_description(3); ?></div> 
         ```
     
 7.  Result:
 8.  WordPress is a favorite blogging tool of mine and I share tips and tricks for 
     using WordPress here.
 9.  Note: if there is no category description, the function returns a br tag.
 10.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%3Freplytocom%3D1236%23feedback-editor-1236)
 11.  [Skip to note 5 content](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#comment-content-1237)
 12.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/category_description/#comment-1237)
 13. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1237)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1237)
 14. **Using Category Slug**
 15. Displays the description of a category, using a category slug.
 16.     ```php
         <?php echo category_description( get_category_by_slug( 'category-slug' )->term_id ); ?> 
         ```
     
 17.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%3Freplytocom%3D1237%23feedback-editor-1237)
 18.  [Skip to note 6 content](https://developer.wordpress.org/reference/functions/category_description/?output_format=md#comment-content-1238)
 19.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/category_description/#comment-1238)
 20. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1238)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%23comment-1238)
 21. **With Category Title**
 22.     ```php
          <div>
          	<strong><?php single_cat_title( __( 'Currently browsing', 'textdomain' ) ); ?></strong>:
         	<?php echo category_description(); ?>
         </div> 
         ```
     
 23. Result:
      [html] <strong>Currently browsing WordPress</strong>: WordPress is a 
     favorite blogging tool of mine and I share tips and tricks for using WordPress
     here. [/html]
 24.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F%3Freplytocom%3D1238%23feedback-editor-1238)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcategory_description%2F)
before being able to contribute a note or feedback.