Plot
Mr. Krabs opens a second location of the Krusty Krab, right next to the original. His fry cook, SpongeBob SquarePants, hopes to be promoted to manager of the new restaurant, but Krabs instead selects his co-worker, Squidward Tentacles, explaining to SpongeBob that he is a "kid" who is too young and immature to handle the position. Depressed, SpongeBob goes to the Goofy Goober ice cream parlor, where he indulges himself with ice cream with his best friend Patrick Star and wakes up the following morning with a hangover.
Krabs' rival Plankton, owner of the Chum Bucket restaurant, initiates "Plan Z" in an attempt to obtain the Krabby Patty secret formula and take over the world. He steals King Neptune's crown, sends it to a place called Shell City, and frames Krabs for the theft. Neptune confronts Krabs about his stolen crown and is convinced of Krabs' guilt when a hungover SpongeBob smears him. Recovering from his hangover, SpongeBob promises Neptune that he will retrieve the crown from Shell City. Neptune freezes Krabs until further notice, telling SpongeBob to return in ten days (until Patrick argues it down to six) or Krabs will be executed. Neptune's daughter, Mindy, encourages SpongeBob and Patrick but warns them of dangers surrounding Shell City, including "the Cyclops", a monster who kidnaps sea creatures.
SpongeBob and Patrick head for Shell City in the Patty Wagon, a Krabby Patty-shaped car stored underneath the restaurant. After the duo leave Bikini Bottom, Plankton steals the formula from the frozen Krabs and uses it to sell Krabby Patties. He distributes free helmets with the Krabby Patties that brainwash customers into doing Plankton's bidding, subsequently taking over Bikini Bottom and hiring a hitman named Dennis to prevent SpongeBob and Patrick from returning with the crown.
SpongeBob and Patrick encounter a hazardous trench, lose the Patty Wagon, and contemplate giving up. Mindy, whom Patrick has a crush on, appears and encourages them by applying fake mustaches made of seaweed, convincing them that she magically turned them from kids into men. Armed with newfound confidence, the two successfully traverse the trench and encounter Dennis on the other side. He demonstrates that the mustaches are fake, and prepares to squash the duo with his boot but is suddenly stepped on by a much larger boot belonging to the "Cyclops", a human diver, who abducts SpongeBob and Patrick.
The duo are placed under a heat lamp by the Cyclops, learning that they have arrived in "Shell City", a gift shop selling dried sea creatures. Proud that they reached their destination, they shed tears just before getting dried up, which short-circuit the lamp and activate the emergency sprinklers, reviving the two alongside the other dried sea creatures. While the sea creatures attack the Cyclops, SpongeBob and Patrick take the crown to the beach, where David Hasselhoff offers them a ride home. Dennis catches up and fights them on Hasselhoff's back, ultimately falling into the sea as Hasselhoff passes under a catamaran.
Neptune arrives to execute Krabs, but SpongeBob and Patrick return with the crown just in time. Plankton drops a mind-control helmet on Neptune and surrounds SpongeBob, Patrick and Mindy with his army of slaves. SpongeBob, embracing the fact that he's accomplished so much despite being a kid, uses the power of rock and roll to play "Goofy Goober Rock", freeing Neptune and the citizens of Bikini Bottom from Plankton's control. As Plankton is arrested by the police, Neptune unfreezes Krabs and the two make amends. Krabs then appoints SpongeBob as the manager of the Krusty Krab 2.