I have a post with only this [gallery id="file"] in text editor but in visual, there appears a gallery. I was moving these posts and updating gallery ids automatically, but these posts don't have any gallery image ids to move or update. I checked the database, I found [gallery id="file"] there in post_content too.

How does this magic work? I need the ids.

1 Answer 1


The default behaviour of the gallery shortcode, when no IDs are given, is to display all images that are attached to the current page/post. An image is attached to a post when it's uploaded directly to a specific post.

  • How do I see these ids then? In the database or wordpress?
    – vtQQ
    Oct 26, 2018 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.