Count identical post titles

I have a review section on the WP website.

I’d like to count posts with the same titles inside the ‘review’ category and display the counter.

I managed to do it with the tag field:

global $post;
$postslist = get_posts( array( ‘post_type’ => ‘reviews’, ‘posts_per_page’ => 20, ‘order’=> ‘ASC’, ‘orderby’ => ‘date’ ) );
foreach ( $postslist as $post ){


// Tag counter
$post_tags = get_the_tags($post->ID);
if ($post_tags) {
foreach($post_tags as $tag){
echo ‘<span class=”review-count”>’ . $tag->count . ‘ review(s)’ . ‘</span>’;

But thought it would be more convenient to use title field instead

Read more here:: Count identical post titles

Leave a Reply

Your email address will not be published. Required fields are marked *