Home » WordPress Tutorials » Maintenance » How to Get Post ID in WordPress

How to Get Post ID in WordPress

Maintenance

The more you play around with WordPress, the more plugin installations you will make. And the more you do that, the higher the chances, for some of them to ask you for a post ID.  And although you might have a perfectly working and functional WordPress website, here you are – finding the URL, and the name of your post, but ID?

Post IDs are useful not only for plugins, but some themes, and even widgets could ask you for an ID of a post.

 

What is Post ID?

As a content management system, WordPress excepts you to have lots and lots of content. And although we see this content as written and stylized words, the database is understanding them as files.

And each of these “files” has a unique number assigned to them.

WordPress’ Post ID is this unique number.

 

How to Find Post ID in WordPress?

Probably the easiest way to find a post ID is from the All posts screen. Going there is becoming something of second nature, once you have enough posts published. On the other hand, if your website is still under construction, and you find yourself in a situation where you need a post ID, here is how to go to the All posts page.

First, you need to enter the WordPress Dashboard. Once there, head for the Posts option in the sidebar menu.

 

 

Now, depending on your permalink settings, and whether the post is published, you can either hover over the view button of the post that you need the ID of or hover over the post’s name.

Doing either of those things will trigger your browser to show you the link you are about to go to.

That link at the bottom of the screen contains the Post ID as well.

 

 

More specifically, the post ID will be the number located between the “post=” and before the “&” symbol.

In the screenshot above, the ID of the post is 130.

If you are currently editing a post in which you want to find the ID, you’ll be able to see it in the Address bar of your browser. Like so:

 

 

As usually the Post ID is not often needed or used as part of WordPress, most users don’t know how to find it.

But as you now know, it is effortless and straightforward to find the ID of a post. The same goes for pages. As, although they are differently shown, pages are posts, as far as the WordPress database is concerned.

Was this post helpful?

i

Relevant tags:

Create your WordPress website today!

Connect

Editor’s picks:

Gutenberg Tutorial: How to Move Blocks in WordPress

What you need to know: The WordPress Block Editor allows you to move blocks up and down the document structure in order to rearrange the content contained within those blocks. The most popular way of moving blocks is by dragging a block from one position and dropping...

Gutenberg Tutorial: Deleting a Block in WordPress

What you need to know: You can delete a block in WordPress by selecting it and pressing the Delete key on your keyboard. Alternatively, you can press the three-dot button in the Contextual Toolbar to access the Remove block option. Lastly, it is also possible to...

Gutenberg Tutorial: Using Block Patterns in WordPress

What you need to know: A block pattern in WordPress is a group of two or more regular WordPress blocks. These blocks come in a sensible layout that you wouldn’t need to modify in most cases. Instead, you just need to add your own content to the block pattern. You can...

Gutenberg Tutorial: Using WordPress Reusable Blocks

What you need to know: Gutenberg features reusable blocks that allow you to quickly insert the same content with one click. You can mark any block or block pattern as reusable. You can find your reusable block collection in the WordPress Block Library. Have you ever...



Create your WordPress website today!


Start now