• 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

How to add a column that displays the WordPress user ID

Discover in this tutorial how to display a custom WordPress admin column that displays the user ID using code.

As a fan of minimalism, I recommend you to remove all the elements that you are not going to use from Genesis and WordPress child themes.

This is especially useful for your customers, because you’ll avoid them “noise” and favor them to have at hand only what they really need to modify.

However, there are situations where you might want to add a new custom column in the WordPress admin.

For example, imagine you need to know a user’s ID to display or hide a menu item.

It’s true that you can find out a user’s ID when you go to edit it and check its URL (unless it’s your own, in which case you should go to the written entries).

But having the ID of all users at hand from the WordPress admin screen can be very convenient if you need to check them often, don’t you think?

In this tutorial you’re going to learn how to enter a custom admin column that displays the ID of WordPress users.

This would be the final result:

Show WordPress User IDs in a new column
Show WordPress User IDs in a new column.

If you are a WordPress implementer or developer I’m convinced that this tutorial will be very useful for you.

Snippet to insert a column with the WordPress user ID in admin

Add the following code snippet to your functionality plugin:

To see this and another 837 code snippets of this website, login or subscribe here.

There you have it.

Conclusions

Do you want to keep user IDs at hand? Now you know how to display them by adding a new column in the WordPress admin with a simple snippet.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits 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?