In WordPress, every item that you create or upload, or is created and uploaded by users has a unique ID assigned to it. It is basically a unique number used to query, identify and read the item for display from the database. This ID is present for almost everything—posts, pages, categories, tags, users, media uploads, comments, and menus. Sometimes, there is a need to identify the ID of such items.

The ID number is used by themes or plugins for special purposes. For example: Featured posts or post sliders require you to input IDs of posts or pages to be featured. Similarly, menu IDs is required by themes to use as the default menu at a certain location. Another real example is Google XML Sitemap Plugin requires the IDs of posts and categories that you want to exclude from the automatically generated sitemap.

In this post, we are going to learn how to get such unique IDs of posts, pages, categories, tags, users, menus, comments and media uploads in WordPress. The basic idea is to edit a content and look at the URL in the address bar for a number. That will give us the unique ID.

Finding ID of Posts

Finding Post ID in WordPress

The basic idea of finding the ID number is the same for the rest of the content. Here are some examples and steps for them:

Finding ID of Pages

Finding ID of Categories

Finding the Category ID in WordPress

Finding ID of Tags

Finding User ID

Finding User ID in WordPress

Please note that while editing the first user or the admin user that was used while setting up WordPress, the URL will not show the user ID. It is always 1 for the first user. For the usernames created after that, the address bar will give the unique ID number.

Finding ID of Media

Finding ID of Media in WordPress

Finding ID of Comments

Finding Comment ID in WordPress

Finding ID of WordPress Menu

Finding Menu ID in WordPress

In WordPress more than one menu can be created and placed in various sections of the theme. There is a primary menu and more than one secondary menus. To find their ID:

Leave a Reply

Your email address will not be published. Required fields are marked *