Add Pingbacks and Trackbacks Column in WP Admin Panel

WordPress admin posts list has several columns which display post title, description, number of comments and many other parameters. Many plugins also add new column to admin post list to display additional information related to that plugin. As we shared earlier, by default WordPress shows number of comments in front of posts title. We are sharing a custom code snippet which can add an extra column for total number of pingbacks and trackbacks in admin panel.

Below is the code snippet which should go into your functions.php file of current theme.

function commentCount($type = 'comments'){
	if($type == 'trackbacks'):
		$typeSql = 'comment_type = "trackback"';
		$oneText = 'One :trackback';
		$moreText = '% :trackbacks';
		$noneText = 'No :trackbacks';
	elseif($type == 'pingbacks'):
		$typeSql = 'comment_type = "pingback"';
		$oneText = 'One :pingback';
		$moreText = '% :pingbacks';
		$noneText = 'No :pingbacks';
	global $wpdb;
    $result = $wpdb->get_var('
            '.$typeSql.' AND
            comment_approved="1" AND
            comment_post_ID= '.get_the_ID()
	if($result == 0):
		echo str_replace('%', $result, $noneText);
	elseif($result == 1):
		echo str_replace('%', $result, $oneText);
	elseif($result > 1):
		echo str_replace('%', $result, $moreText);
add_filter('manage_posts_columns', 'posts_columns_counts', 1);
add_action('manage_posts_custom_column', 'posts_custom_columns_counts', 1, 2);
function posts_columns_counts($defaults){
    $defaults['wps_post_counts'] = __('Counts');
    return $defaults;
function posts_custom_columns_counts($column_name, $id){
	if($column_name === 'wps_post_counts'){
		commentCount('trackbacks'); echo "<br />";


VN:F [1.9.22_1171]
Rating: 9.5/10 (2 votes cast)
Add Pingbacks and Trackbacks Column in WP Admin Panel, 9.5 out of 10 based on 2 ratings
Added by +Webkia - Share this post and win Premium Wordpress Themes!

1 Comment

  1. Add Featured Thumbnail Column to Wordpress Admin Posts List - Webkia · Apr 6, 2013

    [...] I wrote about how to add pingbacks and trackbacks column in admin posts list. This tutorial is about to add featured thumbnail column in your wordpress admin post columns. Does [...]

Leave A Reply