The film starts with a pirate crew, led by Captain Pinty, eagerly awaiting their treasure: tickets to The SpongeBob SquarePants Movie. When they recover it, they sail to the movie theater and sat down at the front row seats to watch the movie.SpongeBob SquarePants has a dream of becoming the manager of the Krusty Krab restaurant and that the restaurant is in danger because a customer named Phil has no cheese on his Krabby Patty, but SpongeBob comes in in a limo and puts cheese to the Krabby Patty to save the day. SpongeBob wakes up from the dream, and happily gets ready for the "Krusty Krab 2" opening ceremony, with the hope that Mr. Krabs will promote him to general manager of the new restaurant. At the opening ceremony, SpongeBob is denied the title, which is instead given to Squidward Tentacles, due to being "more mature" than SpongeBob and Mr. Krabs thinking that he's "just a kid" and is unable to handle the task. Severely depressed, SpongeBob heads to his favorite restaurant, Goofy Goober. There, he eats numerous sundaes with his friend Patrick Star, and wakes up the next morning with a hangover. Meanwhile, Plankton, Krabs' business rival, enactes a plot to steal the Krabby Patty secret formula burger with the dreaded "Plan Z". He steals King Neptune's beloved crown (which Neptune claims symbolizes his authority, even though it is obvious he wants to conceal a bald spot lining the entire top of his head), sends it to Shell City, a hazardous location to which no marine life has ever returned from and is guarded by a killer Cyclops, and leaves a note that says "I stole your crown. Signed, Eugene Krabs". Incensed, Neptune crashes into the Krusty Krab 2 and assaults Krabs. SpongeBob later arrives and bad-mouths Krabs, but, when seeing Krabs' life is at risk, promises Neptune that he will retrieve the crown from Shell City, but Neptune doubts that SpongeBob is capable of that. In the end, though, his compassionate daughter, Mindy, convinces him. He orders SpongeBob to be back with the crown back in exactly ten days, but thanks to Patrick, who seems to overestimate his friend, the time is argued down to six days. So he will not run away, Neptune freezes Krabs with his trident and says that Krabs will fry if SpongeBob does not complete his task. SpongeBob and Patrick then head off for Shell City in a car shaped like a Krabby Patty. With his rival frozen solid, Plankton steals the Krabby Patty formula with ease. Meanwhile, SpongeBob and Patrick meet two owners of a gas station who make fun of them for no apparent reason. As the duo push on, their car is stolen by a thug. Back in Bikini Bottom, Plankton sells the Krabby Patty and makes a huge fortune, claiming Krabs willed the recipe to him. He also sends a hitman named Dennis to pursue SpongeBob and Patrick. Meanwhile, SpongeBob and Patrick recover the car, but are forced to get the key from the thug, who is in a night club where anyone who blows a bubble is mauled. They end up blowing countless and are almost caught, but they escape with the key. Squidward, meanwhile, uncovers the truth about Plankton stealing Neptune's crown and attempts to alert the authorities, but Plankton uses mind-controlling buckets, disguised as souvenirs, to control the residents of Bikini Bottom, including Squidward, and renames the city Planktopolis.

SpongeBob and Patrick pursued by the Shell City's "Cyclops" diver. Meanwhile, SpongeBob and Patrick discover an ice cream stand and buy some, but it is revealed to be a trap created by a frogfish. The frogfish attempts to eat them, but they escape by jumping out of the car. The frogfish eats the car, but is eaten by an eel that lives in a trench filled with carnivorous creatures. Before the two admit defeat, knowing that they can not cross the trench, Mindy appears to give them encouragement by falsely claiming they are men, not kids, by using her "Mermaid Magic" to give them moustaches (strands of seaweed). Singing a song, SpongeBob and Patrick dance their way across the trench with ease, only to meet Dennis on the other side. Before Dennis steps on them with his giant boot, he is stomped on by a human boot. The human, revealed to be the Cyclops Mindy warned them about, grabs SpongeBob and Patrick and heads off for his store by the beach, which is in fact "Shell City" itself; (until the duo returns to the Krusty Krab 2, besides the SpongeBob, Patrick, and the sea animals, the film is shot in the real world). When they arrive, SpongeBob and Patrick find the crown, but encounter a lethal drying-out process which kills them. However, they shed tears that short-circuit the heat lamp, which releases smoke and activates the emergency sprinkler system, reviving them, as well as the other dried-out sea creatures being sold as souvenirs. While the sea creatures attack the Cyclops, including a lobster who sprayed Elmer's glue onto him, SpongeBob and Patrick take the crown out to the beach. After accidentally losing the bag of winds Mindy gave to return to Bikini Bottom, David Hasselhoff offers the two a ride, which they gladly accept. On the way, Dennis catches up to them, but is struck by a catamaran back into the sea. Back at the Krusty Krab 2, Neptune arrives to execute Krabs, while Plankton eagerly watches. In the nick of time, SpongeBob and Patrick return with the crown, save Krabs, and then confront Plankton. In turn, Plankton drops a mind bucket on Neptune. Just as Plankton thinks he is triumphant and has won, SpongeBob, cherishing the fact he is just a kid yet he accomplished a lot in the past six days, five minutes, and 27-and-a-half seconds, uses his imagination to play the Goofy Goober theme in the form of a rock song (a parody of "I Wanna Rock" by Twisted Sister), using his guitar to free Plankton's slaves. Realizing defeat once again, Plankton tries to escape, but is trampled by Bikini Bottom's citizens. Plankton is arrested and incarcerated. King Neptune thanks Mindy for her bravery and unfreezes Krabs, who graciously gives the title of general manager of the Krusty Krab 2 to SpongeBob. During the end credits, SpongeBob is seen doing jobs and chores for Mr. Krabs with an oversized Krusty Krab employee hat.