Age of Article Warning:
This article was originally published a few years ago. The information, tips and techniques explained may outdated. Examples shown on this page may no longer work. Please consider this when viewing the below content.

Wordpress pages and posts all have a unique post ID.This ID allows us to individually change the CSS styling of a particular post or page. It also is useful when working with certain Wordpress plugins such as SEO and sitemaps.So we may want to find out the ID and the easiest way is simply to hover over the post name when looking at the list of posts in the admin section. But another way to have this information readily available is to show the IDs as a new custom column.


To add this new column, simply add these lines of code to your childtheme'ss functions.php file:[php]add_filter('manage_posts_columns', 'posts_columns_postpageID', 5); add_action('manage_posts_custom_column', 'posts_custom_columns_postpageID', 5, 2);add_filter('manage_pages_columns', 'posts_columns_postpageID', 5); add_action('manage_pages_custom_column', 'posts_custom_columns_postpageID', 5, 2); function posts_columns_postpageID($defaults){ $defaults['wps_post_id'] = __('post_page_ID'); return $defaults; } function posts_custom_columns_postpageID($column_name, $id){ if($column_name === 'wps_post_id'){ echo $id; } }[/php]