Finding the Context ID of a Page, Post or media file

If you have used WordPress for a while, you might have come across situations where the “ID” of a particular page / post / media is required. For example, rtMedia shortcodes sometimes requires you to enter the “context_id” of a page or a post in order to properly fetch media.

Context IDs of Pages and Posts

The easiest way to get the context_id of a particular page is to analyse its URL. You can do this by going to the backend of your WordPress website and clicking on “Pages”. This will open up a list of all the pages on your website.

A quick look at the URL in the address bar of your browser will then tell you the context ID of Page that you selected:

Save a few seconds

A quicker way to find the context ID of any page is to hover over its Title, and referring to the URL preview in the bottom left of your browser window:

You can also find the context ID of Posts, media and albums in the same way.

rtMedia-specific context IDs

Here are some rtMedia-specific values, and how to find them:

media_author

This can be passed as a parameter in the rtMedia Gallery shortcode.

Go to Users > All Users in the WordPress backend. Hover over whichever user whose User ID you would like to know. The URL preview in the bottom left of your browser will display the User ID as long as you hover.

album_id

This can be passed as a parameter in the rtMedia Gallery and Uploader shortcodes.

Navigate the the album whose ID you require under Media > Albums in the frontend of your website. Click to open the album. A quick look at the URL in the address bar of your browser will then tell you the album ID of album that you selected:

You can also save a few seconds by  hovering over any album, and referring to the URL preview in the bottom left of your browser window. Refer to the section above.

media_ids

This can be passed as a parameter in the rtMedia Gallery shortcode.

Navigate the the media file whose ID you require under in the frontend of your website. Shift + Click to the media file in single media view, without a lightbox (in a new tab). A quick look at the URL in the address bar of your browser will then tell you the media ID of album that you selected:

You can also save a few seconds by  hovering over any media, and referring to the URL preview in the bottom left of your browser window. Refer to the section above.