ID of images from gallery

You can find out the IDs of which images are included in a gallery by switching to the Text editor tab and look for a piece of code like this:


The comma-separated list of image IDs are enclosed in the ids attribute


If you’re looking to find out IDs of existing images in order to manually create a gallery, you can visit the Media > Library admin menu and click on the Edit link under an image. In your browser’s address bar, you should see something similar to the following:

http://example.com/wp-admin/post.php?post=622&action=edit

The number after post= is the image ID. In this case, the image ID is 622.

Leave a Comment