Discover in this tutorial how to display a custom admin column showing the categories ID using code.
There are situations where you may find it useful to add a new custom column in the WordPress admin.
For example, imagine you need to know a category ID to modify a query or create a new one.
It is true that you can discover the category ID if you go to edit it and check the URL of the category. But having all categories ID at hand from the WordPress administration dashboard can be very convenient if you need to consult it often.
In this tutorial you are going to discover how to enter a custom admin column that displays the WordPress category ID.
This would be the final result:

If you are a WordPress implementer or developer I am convinced that you will find this tutorial very useful.
Snippet to insert a column with the category IDs in WordPress administration dashboard
Add the following code snippet to your functionality plugin:
To see this and another 997 code snippets of this website, login or subscribe here.
In the code above you use the manage_edit-category_columns
and manage_category_custom_column
filters to add the column header and column content respectively.
You also add some CSS to make the column occupy an appropriate width, in this case 50 pixels, but you can adjust it to your liking.
Conclusions
Do you want to keep close the category IDs? Now you know how to display them by adding a new column in the WordPress admin with a simple snippet.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉