• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Display the categories ID in a WordPress admin new column

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:

List of WordPress categories with a new column displaying the ID
List of WordPress categories with a new column displaying the ID.

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 847 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. 😉

Admin area PHP WordPress

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?