Many functions that we write about require you to know what the user ID is and we get asked a lot how to find the user ID. Just as with post, pages, categories, etc the ID is very easy to find and almost always just a matter of viewing the preview URL when hovering over the user to you need the ID of in the user list.
First, in your WordPress admin go to Users > All Users. Hover your cursor over the user that you want to find the ID of.
While hovering your cursor over the user check the preview URL at the bottom of your browser, in Chrome this will be at the bottom left or right of the window as below in our screenshot.
You will see the URL contains ‘user_id=XXXX’ this number is the users ID.