It turns out that Reverend Lovejoy didn't have a valid license to perform weddings when he presided over Homer and Marge's wedding (he had re-married them after their divorce in "A Milhouse Divided"), so they have to get married again, but just when the wedding is about to start, Homer disappears, and the only clue is a key attached to a keychain marked "SB"...but is it Sideshow Bob?
At church, Reverend Lovejoy announces that the Parson will be coming to town. Ned Flanders faints, and Homer leaves to go get "Smelling Salts" (although this was actually an excuse to leave church early). The parson arrives and informs the Reverend that, for a period of 3 months, Reverend Lovejoy was not an official minister, due to a bureaucratical error, and all official things he did during this time are were invalid, such as holding Jasper's wife's funeral, blessing Captain McAllister's ship, and blessing Cletus's house.
When Homer and Marge’s re-marriage turns out to be invalid because Reverend Lovejoy was not licensed at the time, Homer asks Marge to marry him again. Marge takes over as the wedding planner, becoming more and more irritable and lashing out at Homer for whatever he does (demanding non existent blue roses, saying she wants a lemon frosted cake when she told Homer he could pick the frosting, (and he chooses chocolate) and yelling at him when he let Lenny and Carl come). When Homer mysteriously disappears on their wedding day, Bart and Lisa search for answers and are led on a cryptic trail of clues, and find some keys with a keychain that has the initials S.B., leading them to Sideshow Bob (Kelsey Grammer). However, Sideshow Bob was innocent the whole time, thanks to an alibi from Krusty who reveals he was with him. Sideshow Bob helps Bart and Lisa out by pointing out the keychain true initials of SB as his ex-wife and their aunt, "Selma Bouvier". The kids realize Patty and Selma are Homer's true captors, whom both plan to keep Homer cooped up until Marge forgets about him. Realizing what is at stake, Bart and Lisa rush to save him.
Meanwhile, in a parody of Saw, Homer finds himself chained to a pipe in a dark room. When a mysterious voice tells him that the key (which is not the key but the 'hotter sauce') is the 'hotter to unlock his chains is inside a lollipop, he frantically eats it only to discover the lollipop is made of fiery hot sauce and he is tormented as Bart and Lisa race to save him. His kidnappers are Patty and Selma, using a voice modulator, are enjoying their torment and ignoring Apu when he comes in to renew his driver's license. Feeling resigned to his fate, Homer reads the heartfelt wedding vows he wrote for Marge. Despite his problems with Patty and Selma, Homer has kind words for them. This moves Patty and Selma to tears when they see how much Homer loves Marge and releases him. However with the keychain as proof, Bart and Lisa use it to trace them and confirm the twins were behind the kidnapping when the keys fit perfectly in the door lock to their apartment. When they tried to play innocent, Lisa doesn't buy it as she revealed that she and Bart know what the twins did to their father. The kids blackmail Patty and Selma intentionally by threatening to tell Marge about their involvement in Homer's kidnapping unless they pay for their parent's remarriage ceremony, which they reluctantly do. Homer and Marge are at last married outside city hall.