While shopping with his family at a department store, Bart strikes up a conversation with a salesman, who explains how a high-tech looking device in the registry department allows couples about to be married to select gifts they want for their wedding. This gives Bart an idea. He steps up to a computer screen at the wedding registry department and enters his name where it says “name of groom.” He enters “Lotta Cooties” where it says “name of bride.” He then walks through the store with the registry gun and scans barcodes on merchandise throughout the store. Later he and Milhouse send wedding invitations to people throughout town. Bart plans on scamming as many gifts as possible, and what he doesn’t want he’ll return for store credit. On the day of the “wedding,” Bart finds a tent in a park that’s being used for a job fair later in the day. He sets up a cart for people to leave presents. Once the cart is filled with gifts, he wheels it away. Meanwhile the invitees realize there is no wedding. They become trapped inside the tent and begin to pass out from lack of oxygen. Bart continues to wheel away the gifts until Wiggum appears and places him under arrest. Later, inside a courtroom, Judge Harm says that Bart’s criminal record occupies three full storage lockers. She feels she has little choice but to sentence Bart to six months at the Springfield Juvenile Correctional Facility. Bart begs for leniency as he’s led away. Marge begins to sob.

At juvenile prison Bart sadly empties his pockets as the warden inventories the items. He’s then escorted to a jail cell, where he’s taunted by other inmates. Later he’s allowed to watch a heavily edited version of an Itchy and Scratchy cartoon, one with all of the violence cut out. Bart is completely miserable. He and the other kids are allowed to get some exercise in the prison play yard. When he’s harassed by a bully, Bart decides to hang out near the girls’ section, which is separated by a fence. Suddenly a tough girl named Gina reaches through the fence and slashes Bart’s jumpsuit with a barrette. Bart runs off. Another of the juvie girls says it’s obvious that Gina likes Bart. Gina responds with a punch. Back at home Marge continues to sob, blaming herself for Bart’s predicament. The family pays Bart a visit in prison. Homer notices a sign that reads “guards wanted.” He applies for a job at the prison, hoping it will put him closer to Bart. Homer gets the job, and later he dotes on Bart, handing him a lollypop. The other juvies find out that Homer is Bart’s father, and at the first opportunity, they beat up Bart. Later the inmates assemble in the prison gymnasium, where the warden cites a study claiming that juveniles who know how to foxtrot are less likely to commit a violent act. The boys and girls are paired off and handcuffed to each other. Bart ends up with Gina. As Bart and Gina dance, Gina looks up at the disco ball glittering above them. She unties the disco ball, causing her and Bart to be hoisted into the air. Gina hops onto a ledge, taking Bart with her. The warden organizes a search party to retrieve the missing pair.

Gina tells Bart she’s only keeping him around until the chains come off. If they get caught before that happens, she’s going to claim that the escape was all Bart’s idea. Meanwhile Homer, Marge, and Lisa see a news report about the escape. They decide to take action. Back in the woods Bart and Gina spot a blacksmith’s sign. The blacksmith removes the chains, setting Bart and Gina free. Bart impulsively kisses Gina when she admits how much she’ll miss him. Gina responds by punching him. After they separate, Bart finds Gina sitting with her head in her hands. Bart soon realizes that Gina doesn’t have any family. Gina suddenly tackles Bart and they fight. Wiggum and his men spot them and they’re taken into custody. Gina takes full responsibility for the escape, and Wiggum sets Bart free. When Gina returns to her cell, she discovers the Simpsons waiting for her. A lavish feast covers a dining table. Bart tells Gina he thought she’d enjoy a nice family dinner.