After Bart is apprehended for playing pranks on the teachers of Springfield Elementary, Principal Skinner reveals to Bart he is not the greatest prankster to ever walk the halls of the school. Bart is shocked by this revelation and sets out to discover the identity of this prankster. After sifting through countless back issues of the school paper, he discovers that there is a two-week gap in its publication dating back 10 years, and that there is a substantial change in Principal Skinner's demeanor and appearance before and after the gap.
Groundskeeper Willie tells Bart that he was once the school swim instructor, and that Principal Skinner was once fun-loving and laid-back until an incident dubbed "Night of the Wigglers". Here, a prankster locked Skinner in a pool full of earthworms for an entire weekend. Monday was teacher development day, so he was not rescued until Tuesday morning. This experience changed Skinner's personality for the worse. Willie then tells Bart that the prankster was named Andy Hamilton, and not to let Skinner know where he learned the name, or he will kill whoever told him.
Meanwhile, Marge is harshly criticized by other Springfield mothers (mainly by Manjula) for serving unhealthy snacks at their "Midday Mommies" meeting. She burns the family's junk food, to Homer's horror (he tries to put the fire out with whipped cream, but he only makes it worse due to it being a flammable petroleum by-product). The family purchases organic food, which is very expensive and has a short shelf life (much to Homer's chagrin), at a local market.
Unfortunately, at the next meeting, Marge meets with more criticism when she uses non-stick bakeware (which contains PFOAs) and plastic drinking bottles marked with number 7 (which has the potential to leak BPA). The other mothers storm away and Marge realizes that she misses eating junk food. Homer catches Marge eating from his stash of candy, and the two of them indulge in junk food together and apparently make love, and Homer points out that, ironically, the junk food is healthier than organic food. They then agree to only make the kids eat healthy.
Bart meets Andy Hamilton and discovers that he is unemployed and lives with his mother. When Lisa suggests Andy is a loser, Bart gets him a job as Krusty the Clown's assistant, as a favour Krusty owes him, but is angry when Andy quits after one day. Bart gets him rehired and goes to check Andy's progress. When a truck full of earthworms labelled “Prank Grade” drives into the studio, Bart is terrified that Andy is repeating the "Night of the Wigglers" prank and will end up a loser like Skinner (with Skinner watching, and saying "Watch the Krusty Show they tell me, you'll forget your troubles they tell me").
He discovers, however, that it is part of the show (Krusty's line "I wanted warm water, not worm water" is cued in), and that Andy has been hired as a writer for Krusty's show and has a girlfriend, much to Bart's delight. Despite Andy's success, Lisa still thinks that he is a loser, believing that writing for a comedy show is no better than the life of a prankster.