How to Add Post ID Column to Admin Posts List in WordPress

Snippets by IsItWP

Paste into functions.php

//add in a new column in admin for post ID
//Start code
function pagesColumnsHeader($columns) {
	$columns['pageID'] = __('ID');
	return $columns;

add_filter( 'manage_pages_columns', 'pagesColumnsHeader' );

function pagesColumnsRow($columnName, $pageID){
	if($columnName == 'pageID'){
		echo $pageID;

add_filter( 'manage_pages_custom_column', 'pagesColumnsRow', 10, 2 );

function postsColumnsHeader($columns) {
	$columns['postID'] = __('ID');
	return $columns;

add_filter( 'manage_posts_columns', 'postsColumnsHeader' );

function postsColumnsRow($columnTitle, $postID){
	if($columnTitle == 'postID'){
		echo $postID;

add_filter( 'manage_posts_custom_column', 'postsColumnsRow', 10, 2 );
//end column code

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!