If you’re a WordPress developer or site administrator, you’ve probably found yourself needing to quickly reference post IDs whilst working in the admin area. By default, WordPress doesn’t display post IDs in the posts list, which means you have to edit each post or check the URL to find the ID.

WooCommerce does this brilliantly in their product list table, where product IDs are displayed alongside the standard row actions. This inspired me to create a similar solution for regular WordPress posts, pages, and custom post types.
This tutorial shows you how to add post IDs directly to the row actions in your WordPress admin posts list, making them instantly visible and easily accessible.
The Solution
We’ll add a simple function that displays the post ID alongside the existing row actions (Edit, Quick Edit, Trash, etc.) in the posts list table.
The post ID will appear as ID: 123
at the beginning of the row actions, making it immediately visible without cluttering the interface.
Implementation
Add the code below to your theme’s functions.php
file or using a code snippets plugin.