This is a juicy symbol. Broadly, it's a symbol of children's literature, and gets us into hot-button issues of censorship and age-appropriateness. In case you've missed it, Bluebeard is the story of a young bride who marries a serial widower named Bluebeard. The grisly fellow forbids the young bride to enter his secret room. But, overpowered by curiosity, she does. Lo and behold, the room is chock full of wife corpses, and the floor is so bloody the young wife gets some blood on the key, leading to the discovery of her betrayal by Bluebeard. The tale was published by Charles Perault in 1697 in French and has since been frequently adapted in film, theatre, and both written and oral stories. You can find the text here, for free.
Bluebeard ends with the death of Bluebeard. In spite of her curiosity, the young lady survives. Looked at in this way, the story promotes curiosity and values truth coming to light. Young Danny doesn't really recall this part of the story Jack likes to read to him at bedtime, but remembers the gist of it. As Danny tries to fight his extreme curiosity to enter 217, we are told:
It seemed vaguely to Danny that the story had had a happy ending, but that paled to insignificance beside the two dominant images: the taunting, maddening locked door with some great secret behind it, and the grisly secret itself […]. The locked door, and behind it the heads, the severed heads. (19.29)
Interestingly, Danny seems comforted by this thought. Halloran told him that the things in the Overlook are "(like scary pictures in a book)" (19.39). If so, Danny can learn the secret and not get hurt. The only thing that stops his from entering 217 at this moment is his memory of promising Halloran that he wouldn't. The symbol of Bluebeard also tells us something about Danny's character – he's insatiably curious, just like Jack.
Although The Shining isn't accessible to most five-year-olds, Kubrick's film, frequently broadcast on the small screen over the years has probably been seen by more than one youngin'. It has five-year-old appeal too, because of Danny. The question is, for what ages is this story, in its varied forms, appropriate. Is it possible kids can derive some benefit from a story, or from a story like Bluebeard. Do kids like scary stories? Can they avoid hearing them? Childhood is a scary time, because children are at the mercy of adults, as King illuminates in many stories. Can Gothic and horror stories have the same purgative effect on kids that they are supposed to have on adults, or do they just make things worse? For that matter, are such stories good for grown-ups?