Treehouse of Horror V is an Anthology episode that features mini-stories. "The Shinning" is a parody of The Shining where the Simpsons become the winter caretakers of Mr. Burns' mountain lodge and Homer goes insane and tries to murder the family. In "Time and Punishment," Homer repeatedly travels back in time and alters the future. He tries to change things back, but fails and settles for a reality close to his own. In "Nightmare Cafeteria," Principal Skinner begins using detention students as cafeteria food. When Bart and Lisa are about to be slaughtered, Bart wakes up and realizes it is a dream. But immediately afterward, in the closing sequence, he and the family are attacked by fog that turns people inside out.
Marge appears and says, "Hello, once again. As usual, I must warn you all that this year's Halloween show is very, very scary. And those of you with young children may want to send them off to bed at... Oh, my. It seems that the show is so scary, that Congress won't even let us show it. Instead they've suggested the 1947 classic Glenn Ford movie, 200 Miles to Oregon."
A clip of the film then shows. The episode is cut off and Bart's voice is used in radio waves to tell us that he is controlling the programming. Homer also cuts in and plays with the radio waves using his voice, to Bart's annoyance.
When Bart reaches the highlighted line, the Simpsons’ heads appear on the radio line.
"There's nothing wrong with your television set. Do not attempt to adjust your picture. We are controlling the transmission." "What's that, boy? We're in control? Hey, look! I can see my voice! (Laughs) Eep! Eep! Eeeeep! Blup, blup, blup, blup, blup. (Singing loudly and badly) This-is-my voice, on-TV!" "Dad! you're ruining the mood!" "Sorry." "For the next half-hour, we will control what you see and hear. You are about to experience the terror and foul horror of... The Simpsons Halloween Special."
In a parody of the late Stanley Kubrick's 1980 horror classic The Shining, the family gets invited to Mr. Burns' summer cottage to look after it while he goes away. On the way, Homer is forced to drive all the way back home to lock the front door to the house. And on the second drive, he is again forced to turn around to go and lock the back door to the house. On the third drive, Lisa points out that they left Grampa behind—Homer does not comply and keeps driving. Upon arriving, Mr. Burns takes them on a tour of the house. He tells them the long, colorful history of the house. It was built on an ancient Indian Burial Ground (like the Overlook Hotel in The Shining), and was the setting of Satanic rituals, witch burnings, and five John Denver Christmas specials. An elevator opens up and blood spills out all over the entire floor (like in The Shining), prompting Mr. Burns to say, "Hmm, that's odd. Usually, the blood gets off at the second floor." While outside, Bart cuts a shortcut in the hedgemaze with a hedgetrimmer, and annoys Willie and reads his thoughts. Willie tells him that he has "the shinning" to which Bart tries to correct him by saying, "You mean Shining." Willie then shushed him, asking, “You wanna get sued?” He says he should use it to call him if his dad starts to go insane.
Mr. Burns and Smithers cut the power cable and take all the beer away. Smithers comments that this may have been what caused the previous caretakers to go insane and kill their families, but Mr. Burns simply bets that he owes Smithers a Coke if it happens this time again.
The absence of television and beer causes Homer to go insane. He tries to occupy himself, telling the family that he might "go check out that axe collection", causing Lisa to ask Marge if he's gonna kill them, she replies, "We're just gonna have to wait and see." Homer goes to the bar where Moe, as a ghost, tells him he'll give him a beer if he murders his family. Homer is at first uncontent at murdering his family and questions Moe, who replies that they'd be much happier as ghosts. Homer points out that Moe doesn't look so happy, and he dishonestly replies that he is very happy, "La-la, la-la, la-la-la, see? Now waste your family and I'll give you a beer!" Marge goes downstairs to check on Homer, and discovers a typewriter with paper in it ("What he's typed will be a window into his madness."). Marge reads it ("'Feelin' fine.' Whew, that's a relief."), and then lightning lights up the room to reveal that Homer has written "No TV and no beer make Homer go crazy" all over the lounge. Homer then bursts through a door and tries to attack Marge. She defends herself with a bat as he chases her up the stairs. Homer falls down the stairs after seeing his reflection in a mirror and is knocked out. Marge locks him in the dry food celler. Homer is unwillingly released by Moe and a band of demons (including Freddy Krueger, Jason Voorhees, Dracula, the Mummy, the Wolfman, and Pinhead).
While the family is eating dinner, Homer chops down a door with an axe ("Heeeere's Johnny!"), but the room was empty. He chops into another room ("Daaavid Letterman!"), but it was just Grandpa. And then into the right room with a stopwatch in his hand ("I'm Mike Wallace, I'm Marley Safer, and I'm Ed Bradley! All this and Andy Rooney tonight on 60 Minutes!"), the family flees to escape the rampaging Homer. After Marge contacts the police (the crooked cop, Chief Wiggum) to no avail, Bart uses his shinning to call Willie to help. Willie immediately comes to their aid, only to get an axe in the back by Homer. Homer picks up a different axe from the collection hanging on the wall and chases the family outside into the snow and is ready to kill them until Lisa finds Willie's TV radio in the snow. Homer immediately drops the axe to watch Kent Brockman on Channel 6 News. The return of television brings back his sanity. He calls his family to sit in the snow with him to "bask in television's warm, glowing, warming glow" and they freeze while watching. However, Bart tells Homer to change the channel when the announcer informs them that the upcoming programming will be The Tony Awards, hosted by Tyne Daily and Hal Lindon, Homer replies, "Can't. Frozen." As a theme plays, they all scream in terror, and Homer says, "Urge to kill rising."
Homer is sitting down at the table, eating breakfast with the family, commenting that despite his troubles, he feels that he is a really lucky guy sitting down with them in their cozy home in this beautiful free country. Lisa destroys the mood by screaming,"Dad! Your hand is jammed in the toaster!" Homer panics and runs aroung frantically trying to get it off. He succeeds and throws it across the room, he sighs heavily in relief, and slumps down against the fridge. Bart cries,"Dad, it's in there again!" causing another panic to get it off. Homer attempts to fix it using the tools in the basement. The next morning, he takes it for a test-toast. The modifications to the toaster turn it into a time machine, and Homer is sucked into the time-space continuim. Homer states he's the first non-Brazilian person to travel back in time, but then he meets up with Sherman and Mr. Peabody from The Rocky & Bullwinkle Show, the latter correctshim on being the second. Homer travels back to the time of the dinosaurs, and realizes that touching anything will impact the future. When he accidentally kills a mosquito, he returns to find that Flanders is the unquestioned lord and master of the world.
After escaping his "Re-Neducation" (a process that includes a glass of warm milk, a lie down, and a total frontal lobotomy), he goes back to the time of the dinosaurs in hopes to change the future, and ends up accidentally sitting a fish ("Oh, I wish, I wish I hadn't killed that fish.") while escaping from a T-Rex. He returns only to find that Bart and Lisa are giants that mistake him for a bug that "looks a lot like Dad", they then try to smash him.
His third attempt to change the past succeeds in him wiping out all the dinosaurs by sneezing on another T-Rex, who in turn sneezes on another dinosaur, which also sneezes on another dinosaur and so on, and they all drop dead. Before returning to the future, Homer says grimly,"This is gonna cost me." He returns to the future in the basement. He goes upstairs to see a large, fancy kitchen, he scans the room to see his family, who are all dressed elegantly. Homer, at first oblivious, cries,"D'oh! I mean, hey." Bart presents him with the morning paper, addressing him as "Father, dear." and Lisa asks if they're taking the new Lexus to Patty and Selma's funeral. Homer counts out the perfections in his life, exclaiming,"Whoo-hoo! I hit the jackpot!" As he sits down, he asks Marge, very kindly, to pass him a donut. Marge replies,"What's a donut?" Homer screams uncontrollably at this shocking discovery and runs back to the basement and the sound of the time machine zapping is heard. After he is gone, donuts begin to fall from the sky and Marge says,"It's raining again," implying that the rain in this universe is donuts.
Homer returns to his basement to discover Groundskeeper Willie in his kitchen. Willie says,"You're still not in your own world, Homer. I can get you home, but you have to do exactly as I--AAHH!!" he fall to the floor, showing that Maggie has killed him with an axe. Maggie takes out her pacifier and says in the deep, distinctive voice of James Earl Jones,"This is indeed a disturbing universe."
Homer returns to the dinosaur era. Holding a club, he yells,"Don't touch anything? I'll touch whatever I feel like!" and destroys anything in the past that he can before returning to the future. The family's house in the future ends up changing multiple times. First it changes to an igloo, then to a caveman house, then to a MacDonald's, then to an underwater house, then to a giant shoe, then to Sphinx with Bart's head, where Kang and Kodos make their brief appearance, watching from their spaceship. Kang comments that Homer is totally unprepared for the effects of time travel, they both laugh at Homer's suffering. Homer finally stops and returns to the present. He returns to the kitchen and asks Marge several questions: his name, the color of the sky, and what of donuts. Marge answers them all accurately. Homer, now satisfied, sits down to eat with the family. Everything appears to not be what it seems when the family start eating a breakfast with lizard tongues. Homer decides it is close enough.
Skinner discovers a common solution to both problems: eating the detention students. Jimbo Jones trips Lunchlady Doris, accidentally spilling stew all over himself. Skinner takes a taste of the stew, and is impressed with the Jimbo/stew combination. Skinner orders Jimbo to help Lunchlady Doris in the cafeteria, and Jimbo is put to work cleaning a giant pot while someone spills meat tenderizer on him. Eventually the lid is closed on him and Jimbo is killed and cooked, ending up being served as "Sloppy Jimbos" in the teachers' lounge and the cafeteria. Everyone likes the new dish, especially the teachers: "Mmmm ... this sandwich tastes so young and impudent." In the cafeteria, Üter cuts in line to get another Sloppy Jimbo, and Skinner sends him to detention.
Lisa becomes suspicious when Üter disappears and a German meal called "Üterbraten" is served in the cafeteria. Lisa asks Bart if he find that to be strange. Skinner, overhearing the conversation, says he's got a "gut feeling" that Üter is still around, asks, "Isn't there a little Üter in all of us?", and then says "You might even say we just ate Üter and he's in our stomachs right now!" Skinner then backpedals, telling Bart Lisa and to "scratch that one," but it's too late: Now they all think that something's up.
At home, Bart and Lisa and tries to tell Marge what's happening at school, but Marge doesn't believe them. She says that since they're eight and ten years old now, she can't be fighting all their battles for them, and they should just look the teachers straight in the eye and say, "Don't eat me!" Disappointed, Bart and Lisa reluctantly return to school. Eventually, so many students are in "permanent detention" (according to Mrs. Krabappel now fat) that the remaining students have all been merged into one class. Only Bart, Lisa, Milhouse, Wendell, and Ralph are left. When Wendell drops his pencil and Mrs. Krabappel gleefully sends him to detention and is pressumbly killed, Milhouse sees Mrs. Krabappel reading a book titled The Joy of Cooking Milhouse, and he suggests to Bart and Lisa that the three of them should make a break for it, since any one of them could be next.
The trio sneak down the hall, but are caught by Lunchlady Doris, who charges at them with a spinning eggbeater. Groundskeeper Willie tries to come to their rescue, but is quickly killed by Skinner hitting him in the back with an axe. Skinner and the teachers advance on the three students, and they are quickly cornered on a ledge above a giant food processor, which Skinner turns on and switches to the "gooify" setting. As they're forced closer to the edge, Bart tells Lisa and Milhouse not to worry and says that something always comes along to save them. When Milhouse falls into the food processor and is instantly "gooified," killing Milhouse. Bart changes his statement to "Something will come along and save the two Simpson children." No rescue comes, however, and Bart and Lisa are also forced over the edge, screaming as they fall toward the rapidly whirling blades of the food processor.
Immediately after falling into the food processor, Bart screams and wakes up to find out it was all a dream. Marge reassures him that there's nothing to worry about except the mysterious fog that turns people inside out. The fog then seeps in through the window and does just that (interestingly, the drawings of the skinned characters show a discontinuity in the bottom area suggesting an earlier version of the animation was retouched so to erase the buttocks). The family and Groundskeeper Willie all begin to do a musical number (to the tune of "One" from A Chorus Line) about being turned inside out. At the end, Santa's Little Helper drags Bart offstage by his intestines.
David Mirkin deliberately placed more graphic violence in the episode due to complaints about excessive violence in the show. The episode features a recurring joke in every story where Groundskeeper Willie is struck in the back with an axe when trying to help someone. Willie even lampshades this in the last sketch, saying "I'm bad at this".
This episode is known as one of the most graphic of the show, and has negative reviews from some fans about the gore. Strangely, the episode is only rated PG in the UK, despite being more graphic than the 12-rated Treehouse of Horror X. It was originally TV-PG in America, but re-rated TV-14. Sometimes, when the episode is on TV, the end is removed, and the blood was removed from Lunchlady Doris' apron. Also in Australia it is rated M on Fox 8.