Title: Display Total Number of Published Posts
Last modified: August 19, 2016

---

# Display Total Number of Published Posts

 *  [eddyj](https://wordpress.org/support/users/eddyj/)
 * (@eddyj)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/display-published-post-number/)
 * Hi, you know in admin under posts it shows you at the top a number under the 
   word Published based on how many have been published. And if you hit delete on
   1 it automatically updates that number or if you add a post it updates it.
 * Is there a way to display that number on the front of my blog? As all my posts
   are videos I want to show how many published videos there are like
 * 1,456 Videos online
 * Then as more are added it would show the update or deletion in the numbers
 * There must be an easy way to do it as it exists inside the admin area for published
   number
 * anyone know the code i would insert

Viewing 1 replies (of 1 total)

 *  Thread Starter [eddyj](https://wordpress.org/support/users/eddyj/)
 * (@eddyj)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/display-published-post-number/#post-1568882)
 * Found it dont worry here it is for others
 *     ```
       <?php echo $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'");
       if (0 < $numposts) $numposts = number_format($numposts); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Display Total Number of Published Posts’ is closed to new replies.

## Tags

 * [number](https://wordpress.org/support/topic-tag/number/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [eddyj](https://wordpress.org/support/users/eddyj/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/display-published-post-number/#post-1568882)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
