This tutorial will elaborate four methods on “How to find page ID in WordPress.” Three methods mentioned below are for common WordPress users who don’t know how to code in WordPress. One method is for those who know how to code in WordPress.
How to Find Page ID in WordPress: Table of Contents
- From the pages’ admin section.
- Using “Show IDs” plugin.
- Using a code snippet.
- Changing the permalinks (Not Recommended).
From the Pages’ Admin Section
Go to Pages -> All Pages.
Open the page for which you want to find the id. Let’s say “Sample Page.”
Now, check the address bar of your browser.
Did you notice the black “Rectangle” in the above screenshot? Here, the id for my page is “2.”
Using “Show IDs” Plugin
In this method, we are going to use “Show IDs” plugin. So, download the plugin from here, install and activate it. There are no settings needed from your end. So just go to “Pages -> All Pages”, and you’ll see a column added to the list of pages.
Note: The plugin also supports custom post types, custom taxonomies, link categories, comments, users, media, links, tags, categories, and posts.
Using a Code Snippet
Paste the following code in the WordPress loop.
<?php echo get_the_ID(); ?>
Changing the Permalinks
Note: This method is not recommended to find the page id.
Go to Settings -> Permalinks.
Change the permalinks setting to “Plain” and hit the “Save Changes” button.
Now, open the page from the front side for which you want to find the id. Now the URL of the page would be like:
Here, “2” is the page id.