Main plot
Alarm clocks ring everywhere throughout SpongeBob's house and even in Squidward's house. SpongeBob's foghorn alarm spits out some more, and SpongeBob wakes up and stops them. SpongeBob remembers that, on this day, the Krusty Krab celebrates its "eleventy seventh" anniversary. He remembers his first visit to the Krusty Krab and tells Gary about it: Years ago, when SpongeBob's mother was still pregnant with him, she and SpongeBob's father went to the Krusty Krab to eat there. His mother asked him what he wanted , and he asked for a Krabby Patty. They were so good, SpongeBob took off his umbilical cord and sucked on it. When he finishes his flashback, SpongeBob showers, goes through the wringer, puts on his clothes and drinks a can of socks . He then puts on his shoes and goes over to the mirror, opens the door on it and looks through a collection of his faces. He takes off the one he already has on, and then replaces it with his "eager face". SpongeBob then leaves to go to the Krusty Krab, but as soon as he exits his house, he bumps into the back of an unbelievably long line of customers waiting to get to the restaurant as well. SpongeBob jumps on top of every second person in the line, then eventually reaches the Krusty Krab front door and squirms underneath it.
Mr. Krabs tells SpongeBob and Squidward that this is a perfect opportunity for his arch-nemesis Plankton to steal the Krabby Patty formula . Krabs has hired Patrick as a security guard, so that he does not have to pay for a real one. SpongeBob spectacularly decorates the Krusty Krab with ketchup, mustard and pink toilet paper. He then turns the Krabby Patties into balloons with an air pump, but then mentions that has one last decoration. Patrick, Squidward and Mr. Krabs follow SpongeBob into the freezer where he shows them a giant Krabby Patty ice sculpture which he made himself. However, in attempt to take the ice sculpture outside, they accidentally knock SpongeBob out the open freezer door; he then rebounds of the kitchen door and back into the freezer. The impact shuts the door and it locks, trapping all four friends inside. While finding their way through air shafts, they look back at some memorable moments in their lives, including the first Krabby Patty commercial in which Krabs, baby SpongeBob and his parents played , the time Mr. Krabs first conveyed the Krabby Patty formula to SpongeBob while they travelled around the world, the day SpongeBob moved to Bikini Bottom (Squidward had planted a miniature garden beside his house, when suddenly SpongeBob's pineapple house fell out of the sky, landed on top of Squidward and destroyed his garden), and also a time when SpongeBob and Sandy got married - which turned out to be a play without the priest knowing. .
To get out of the air shaft, SpongeBob gathers Squidward, Patrick, and Mr. Krabs to bust out the shaft, but it takes a few tries, On his last try, he says to himself, OK, this is the one! Feel very good about this! OK, steady..., and he finally makes it out, only to find that all the customers have left after waiting for so long without getting any food. However, SpongeBob summons them all back as he sings a song in honour of the Krusty Krab, called "Oh, Krusty Krab" . Meanwhile, Plankton finally finds the perfect opportunity to steal the Krabby Patty secret formula. He fails, having Mr. Krabs to launch him, but Plankton tells Krabs that he cannot take any more launches, having been launched countless by Krabs times in the past. So, Krabs instead inflates Plankton into a balloon and floats him up into the sky. The eleventy seventh anniversary celebration then goes ahead.
Patchy the Pirate subplot
Patchy is hosting a SpongeBob SquarePants show, starring several celebrities such as Pink, Queen Elizabeth II, Abraham Lincoln and SpongeBob himself. Patchy is looking forward to seeing SpongeBob in person , but when SpongeBob does not show up, Patchy is furious and goes out to find him. Meanwhile, the celebrities are bored and ask Potty the Parrot for several things, but Potty just tells them to wait and goes back to his job. P!nk and her band then practice a song and Queen Elizabeth asks Potty how she can eat a pineapple if there is not a slicer or a knife to cut it open. Afterwards, Patchy sets sail in his boat and soon arrives at the island above Bikini Bottom. However, just as he nears the island, he is swallowed whole by a whale.
Patchy later shows the audience some clips of SpongeBob whilst in the belly of the whale, including different character versions of the SpongeBob SquarePants theme song and an old SpongeBob episode in a 1930s cartoon format , but the projector breaks down. The smoke from the projector causes the whale to sneeze Patchy out through its blowhole, and Patchy lands back in the studio. When he lands, Patchy falls unconscious and dreams that he is at SpongeBob's house. Delighted, he dances around a few times and then knocks on SpongeBob's door. SpongeBob answers the door and says hello, but Patchy cannot believe his own eyes and passes out again. He then wakes up in the studio, depressed that it was just a dream. However, Queen Elizabeth assures him that he can see SpongeBob anywhere and then Abraham Lincoln lifts up his top hat, revealing a toy SpongeBob that laughs. Upon seeing and hearing this, Patchy faints a third time.