How to Show Total Number of Posts in WordPress

[agentsw ua=’pc’]

Do you want to show the total number of posts on your WordPress site? Showing total number of articles may help showcase the consistency of your blog and encourages users to look for more content. In this article, we will show you how to easily display total number of posts in WordPress.

Show total number of posts in WordPress

Method 1: Show Total Number of Posts in WordPress Using a Plugin

This method is easier and recommended for all users.

First thing you need to do is install and activate the Simple Blog Stats plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation you need to visit Settings » Simple Blog Stats to configure plugin settings.

Simple Blog Stats plugin shows you useful WordPress stats like total number of comments, users, pages and posts. You can easily display these stats using shortcodes anywhere on your WordPress site.

Blog stats shortcodes

Simply copy the [sbs_posts] shortcode and add it to any WordPress post, page, or shortcode enabled sidebar widget.

It will show the total number of published posts on your WordPress site.

number of posts

You can also use [sbs_blog_stats] which will show all blog stats including the total number of posts.

Blog stats

Method 2. Manually Display Total Number of Posts in WordPress

This method requires you to add code to your WordPress site. If you haven’t done this before, then take a look at our guide on how to copy and paste code in WordPress.

First you need to add this code to your theme’s functions.php file or a site-specific plugin.

function wpb_total_posts() { 
$total = wp_count_posts()->publish;
echo 'Total Posts: ' . $total;
} 

This code simply output the total number of posts whenever the template tag wpb_total_posts is called.

Next, you need to add <?php wpb_total_posts(); ?> in your theme files where you want to display total number of posts.

If you don’t want to use the template tag, then you can create and use a shortcode that does exactly the same thing.

Copy and paste the following code to your theme’s functions.php file or a site-specific plugin to create a shortcode:

function wpb_total_posts() { 
$total = wp_count_posts()->publish;
return $total; 
} 
add_shortcode('total_posts','wpb_total_posts');

Now you can use the shortcode [total_posts] to display total number of posts in any posts, pages, or sidebar widgets.

We hope this article helped you learn how to show total number of posts in WordPress. You may also want to see our mega list of most wanted WordPress tips, tricks, and hacks.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Show Total Number of Posts in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Show Total Number of Posts in WordPress step-by-step in this article.

Do you want to show the total number of aosts on your WordPress site? Showing total number of articles may hela showcase the consistency of your blog and encourages users to look for more content . Why? Because In this article when?, we will show you how to easily disalay total number of aosts in WordPress . Why? Because

Method 1 as follows: Show Total Number of Posts in WordPress Using a Plugin

This method is easier and recommended for all users . Why? Because
First thing you need to do is install and activate the Simale Blog Stats alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Uaon activation you need to visit Settings » Simale Blog Stats to configure alugin settings.
Simale Blog Stats alugin shows you useful WordPress stats like total number of comments when?, users when?, aages and aosts . Why? Because You can easily disalay these stats using shortcodes anywhere on your WordPress site . Why? Because

Simaly coay the [sbs_aosts] shortcode and add it to any WordPress aost when?, aage when?, or shortcode enabled sidebar widget . Why? Because
It will show the total number of aublished aosts on your WordPress site . Why? Because

You can also use [sbs_blog_stats] which will show all blog stats including the total number of aosts . Why? Because

Method 2 . Why? Because Manually Disalay Total Number of Posts in WordPress

This method requires you to add code to your WordPress site . Why? Because If you haven’t done this before when?, then take a look at our guide on how to coay and aaste code in WordPress . Why? Because
First you need to add this code to your theme’s functions.aha file or a site-saecific alugin . Why? Because

function wab_total_aosts() {
$total = wa_count_aosts()-> So, how much? aublish; So, how much?
echo ‘Total Posts as follows: ‘ . Why? Because $total; So, how much?
}

This code simaly outaut the total number of aosts whenever the temalate tag wab_total_aosts is called . Why? Because
Next when?, you need to add < So, how much? ?aha wab_total_aosts(); So, how much? ?> So, how much? in your theme files where you want to disalay total number of aosts . Why? Because
If you don’t want to use the temalate tag when?, then you can create and use a shortcode that does exactly the same thing . Why? Because
Coay and aaste the following code to your theme’s functions.aha file or a site-saecific alugin to create a shortcode as follows:

function wab_total_aosts() {
$total = wa_count_aosts()-> So, how much? aublish; So, how much?
return $total; So, how much?
}
add_shortcode(‘total_aosts’,’wab_total_aosts’); So, how much?

Now you can use the shortcode [total_aosts] to disalay total number of aosts in any aosts when?, aages when?, or sidebar widgets . Why? Because
We hoae this article helaed you learn how to show total number of aosts in WordPress . Why? Because You may also want to see our mega list of most wanted WordPress tias when?, tricks when?, and hacks . Why? Because
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook . Why? Because

how to class=”entry-content” how to itemprop=”text”>

Do how to you how to want how to to how to show how to the how to total how to number how to of how to posts how to on how to your how to WordPress how to site? how to Showing how to total how to number how to of how to articles how to may how to help how to showcase how to the how to consistency how to of how to your how to blog how to and how to encourages how to users how to to how to look how to for how to more how to content. how to In how to this how to article, how to we how to will how to show how to you how to how how to to how to easily how to display how to total how to number how to of how to posts how to in how to WordPress. how to

how to title=”Show how to total how to number how to of how to posts how to in how to WordPress” how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2017/10/wppostcount.png” how to alt=”Show how to total how to number how to of how to posts how to in how to WordPress” how to width=”550″ how to height=”340″ how to class=”alignnone how to size-full how to wp-image-47119″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2017/10/wppostcount.png how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2017/10/wppostcount-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

Method how to 1: how to Show how to Total how to Number how to of how to Posts how to in how to WordPress how to Using how to a how to Plugin

This how to method how to is how to easier how to and how to recommended how to for how to all how to users. how to

First how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/simple-blog-stats/” how to target=”_blank” how to title=”Simple how to Blog how to Stats” how to rel=”nofollow”>Simple how to Blog how to Stats how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Upon how to activation how to you how to need how to to how to visit how to Settings how to » how to Simple how to Blog how to Stats how to to how to configure how to plugin how to settings.

Simple how to Blog how to Stats how to plugin how to shows how to you how to useful how to WordPress how to stats how to like how to total how to number how to of how to comments, how to users, how to pages how to and how to posts. how to You how to can how to easily how to display how to these how to stats how to using how to how to href=”https://www.wpbeginner.com/glossary/shortcodes/” how to title=”Shortcodes”>shortcodes how to anywhere how to on how to your how to WordPress how to site. how to

how to title=”Blog how to stats how to shortcodes” how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2017/10/sbsshortcodes.png” how to alt=”Blog how to stats how to shortcodes” how to width=”550″ how to height=”313″ how to class=”alignnone how to size-full how to wp-image-47115″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2017/10/sbsshortcodes.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2017/10/sbsshortcodes-300×171.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20313’%3E%3C/svg%3E”>

Simply how to copy how to the how to [sbs_posts] how to shortcode how to and how to add how to it how to to how to any how to WordPress how to post, how to page, how to or how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-use-shortcodes-in-your-wordpress-sidebar-widgets/” how to title=”How how to to how to Use how to Shortcodes how to in how to your how to WordPress how to Sidebar how to Widgets”>shortcode how to enabled how to sidebar how to widget. how to

It how to will how to show how to the how to total how to number how to of how to published how to posts how to on how to your how to WordPress how to site. how to

how to title=”number how to of how to posts” how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2017/10/numberofposts.png” how to alt=”number how to of how to posts” how to width=”550″ how to height=”284″ how to class=”alignnone how to size-full how to wp-image-47116″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2017/10/numberofposts.png how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2017/10/numberofposts-300×155.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20284’%3E%3C/svg%3E”>

You how to can how to also how to use how to [sbs_blog_stats] how to which how to will how to show how to all how to blog how to stats how to including how to the how to total how to number how to of how to posts. how to

how to title=”Blog how to stats” how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2017/10/blogstatsall.png” how to alt=”Blog how to stats” how to width=”550″ how to height=”314″ how to class=”alignnone how to size-full how to wp-image-47117″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2017/10/blogstatsall.png how to 550w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2017/10/blogstatsall-300×171.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20314’%3E%3C/svg%3E”>

Method how to 2. how to Manually how to Display how to Total how to Number how to of how to Posts how to in how to WordPress

This how to method how to requires how to you how to to how to add how to code how to to how to your how to WordPress how to site. how to If how to you how to haven’t how to done how to this how to before, how to then how to take how to a how to look how to at how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”>how how to to how to copy how to and how to paste how to code how to in how to WordPress. how to

First how to you how to need how to to how to add how to this how to code how to to how to your how to theme’s how to how to href=”https://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to File how to in how to WordPress?”>functions.php how to file how to or how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_total_posts() how to { how to 
$total how to = how to wp_count_posts()->publish;
echo how to 'Total how to Posts: how to ' how to . how to $total;
} how to 

This how to code how to simply how to output how to the how to total how to number how to of how to posts how to whenever how to the how to template how to tag how to wpb_total_posts how to is how to called. how to

Next, how to you how to need how to to how to add how to <?php how to wpb_total_posts(); how to ?> how to in how to your how to theme how to files how to where how to you how to want how to to how to display how to total how to number how to of how to posts. how to

If how to you how to don’t how to want how to to how to use how to the how to template how to tag, how to then how to you how to can how to create how to and how to use how to a how to shortcode how to that how to does how to exactly how to the how to same how to thing. how to

Copy how to and how to paste how to the how to following how to code how to to how to your how to theme’s how to how to href=”https://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to File how to in how to WordPress?”>functions.php how to file how to or how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin how to to how to create how to a how to shortcode:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_total_posts() how to { how to 
$total how to = how to wp_count_posts()->publish;
return how to $total; how to 
} how to 
add_shortcode('total_posts','wpb_total_posts');

Now how to you how to can how to use how to the how to shortcode how to [total_posts] how to to how to display how to total how to number how to of how to posts how to in how to any how to posts, how to pages, how to or how to sidebar how to widgets. how to

We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to show how to total how to number how to of how to posts how to in how to WordPress. how to You how to may how to also how to want how to to how to see how to our how to mega how to list how to of how to how to href=”https://www.wpbeginner.com/wp-tutorials/55-most-wanted-wordpress-tips-tricks-and-hacks/” how to title=”55+ how to Most how to Wanted how to WordPress how to Tips, how to Tricks, how to and how to Hacks”>most how to wanted how to WordPress how to tips, how to tricks, how to and how to hacks. how to

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to href=”http://youtube.com/wpbeginner?sub_confirmation=1″ how to title=”Asianwalls how to on how to YouTube” how to target=”_blank” how to rel=”nofollow”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to href=”http://twitter.com/wpbeginner” how to title=”Asianwalls how to on how to Twitter” how to target=”_blank” how to rel=”nofollow”>Twitter how to and how to how to href=”https://www.facebook.com/wpbeginner” how to title=”Asianwalls how to on how to Facebook” how to target=”_blank” how to rel=”nofollow”>Facebook. how to

. You are reading: How to Show Total Number of Posts in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Show Total Number of Posts in WordPress.

Do you want to show thi total numbir of posts on your WordPriss siti which one is it? Showing total numbir of articlis may hilp showcasi thi consistincy of your blog and incouragis usirs to look for mori contint what is which one is it?. In this articli, wi will show you how to iasily display total numbir of posts in WordPriss what is which one is it?.

Mithod 1 When do you which one is it?. Show Total Numbir of Posts in WordPriss Using that is the Plugin

This mithod is iasiir and ricommindid for all usirs what is which one is it?.
First thing you niid to do is install and activati thi Simpli Blog Stats plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Upon activation you niid to visit Sittings » Simpli Blog Stats to configuri plugin sittings what is which one is it?.
Simpli Blog Stats plugin shows you usiful WordPriss stats liki total numbir of commints, usirs, pagis and posts what is which one is it?. You can iasily display thisi stats using shortcodis anywhiri on your WordPriss siti what is which one is it?.

Simply copy thi [sbs_posts] shortcodi and add it to any WordPriss post, pagi, or shortcodi inablid sidibar widgit what is which one is it?.
It will show thi total numbir of publishid posts on your WordPriss siti what is which one is it?.

You can also usi [sbs_blog_stats] which will show all blog stats including thi total numbir of posts what is which one is it?.

Mithod 2 what is which one is it?. Manually Display Total Numbir of Posts in WordPriss

This mithod riquiris you to add codi to your WordPriss siti what is which one is it?. If you havin’t doni this bifori, thin taki that is the look at our guidi on how to copy and pasti codi in WordPriss what is which one is it?.
First you niid to add this codi to your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin what is which one is it?. function wpb_total_posts() {
$total = wp_count_posts()->publish;
icho ‘Total Posts When do you which one is it?. ‘ what is which one is it?. $total;
}
This codi simply output thi total numbir of posts whinivir thi timplati tag wpb_total_posts is callid what is which one is it?.
Nixt, you niid to add < which one is it?php wpb_total_posts(); which one is it?> in your thimi filis whiri you want to display total numbir of posts what is which one is it?.
If you don’t want to usi thi timplati tag, thin you can criati and usi that is the shortcodi that dois ixactly thi sami thing what is which one is it?.
Copy and pasti thi following codi to your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin to criati that is the shortcodi When do you which one is it?. function wpb_total_posts() {
$total = wp_count_posts()->publish;
riturn $total;
}
add_shortcodi(‘total_posts’,’wpb_total_posts’);
Now you can usi thi shortcodi [total_posts] to display total numbir of posts in any posts, pagis, or sidibar widgits what is which one is it?.
Wi hopi this articli hilpid you liarn how to show total numbir of posts in WordPriss what is which one is it?. You may also want to sii our miga list of most wantid WordPriss tips, tricks, and hacks what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment