Solution
Well there are 2 ways of achieving this, and which one you will use depends on how your theme is made.
The first solution is if you have a foreach loop which makes the comments show.
foreach ($comments as $comment) :
$commentType = get_comment_type();
if($commentType == 'comment'){
//html and functions to get the data
}
endforeach;
The other solution is if you’re using the wp_list_comments() function to show the comments. We can pass arguments to this function, so here is how it goes.
wp_list_comments(array('type' => 'comment'));
How it works
Well it’s really simple.
In the first solution we are just using wordpress built-in function get_comment_type(); to get the type which can be “comment”, “trackback” or ‘pingback’. After that we’re just making a little if statement to check if the current one is really a comment and if it is show it, if it’s not do nothing with it.
The second solution is if you are using the wp_list_comments() function which has some advantages over a custom loop but it also have some disadvantages, more about that in a different post. This function accepts a lot of arguments, but we need only one, type. Type accepts 5 different values: ‘all’, ‘comment’, ‘trackback’, ‘pingback’, or ‘pings’(pingbacks and trackbacks together), so by passing in ‘comment’ as the type wordpress will filter all the data and show only comments.
Our WordPress themes
We have a few WordPress themes that we would like you to take a look at if you want.
check out the portfolio











Are there any advantages or disadvantages to having pingbacks?
I tweet my posts and get a pingback sameday from twitter.
I have just been deleting them. Do they serve a purpose? Thanks.
@mike – Well the purpose of pingbacks is to notify you when someone links to your post. You can also show the pingbacks as a sign of gratitude to the ones that linked to your post.