Title: displaying post amount
Last modified: August 19, 2016

---

# displaying post amount

 *  [reececom](https://wordpress.org/support/users/reececom/)
 * (@reececom)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/displaying-1/)
 * Hello
    I’m in a bit of a pickle with a wordpress function.. Im trying to display
   the amount of posts my blog has made..
 * Example:
    <p>Our site has XXX posts</p>
 * Any help would be greatly appreciated

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

 *  [Shane G.](https://wordpress.org/support/users/shane-g-1/)
 * (@shane-g-1)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/displaying-1/#post-1452088)
 * Hi,
 * Refer this article:
 * [http://codex.wordpress.org/Function_Reference/wp_count_posts](http://codex.wordpress.org/Function_Reference/wp_count_posts)
 * Also check with this plugin:
 * [http://wordpress.org/extend/plugins/post-count/](http://wordpress.org/extend/plugins/post-count/)
 * Thanks,
 * Shane G.
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/displaying-1/#post-1452101)
 *     ```
       <?php
       $num_posts = wp_count_posts( 'post' );
       $num_pages = wp_count_posts( 'page' );
       $num_comm = wp_count_comments( );
       $num_cats  = wp_count_terms('category');
       $num_parent_cats=count(get_categories('parent=0&hide_empty=0'));
       $num_child_cats = $num_cats-$num_parent_cats;
       $num_tags = wp_count_terms('post_tag');
       echo '<p>number of published posts: ' . $num_posts->publish . '</p>';
       echo '<p>number of draft posts: ' . $num_posts->draft . '</p>';
       echo '<p>number of pending posts: ' . $num_posts->pending . '</p>';
       echo '<p>number of future posts: ' . $num_posts->future . '</p>';
       echo '<p>number of trash posts: ' . $num_posts->trash . '</p>';
       echo '<p>number of published pages: ' . $num_pages->publish . '</p>';
       echo '<p>number of draft pages: ' . $num_pages->draft . '</p>';
       echo '<p>number of pending pages: ' . $num_pages->pending . '</p>';
       echo '<p>number of future pages: ' . $num_pages->future . '</p>';
       echo '<p>number of trash pages: ' . $num_pages->trash . '</p>';
       echo '<p>number of approved comments: ' . $num_comm->approved . '</p>';
       echo '<p>number of moderated comments: ' . $num_comm->moderated . '</p>';
       echo '<p>number of spam comments: ' . $num_comm->spam . '</p>';
       echo '<p>number of trashed comments: ' . $num_comm->trash . '</p>';
       echo '<p>number of categories: ' . $num_cats . '</p>';
       echo '<p>number of child categories: ' . $num_child_cats . '</p>';
       echo '<p>number of tags: ' . $num_tags . '</p>';
       ?>
       ```
   

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

The topic ‘displaying post amount’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/displaying-1/#post-1452101)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
