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. Meanwile Pac-Man and Ms. Pac-Man go to Bikini Bottom with their friends Babs and Buster Bunny to visit the sponge & are led by Ariel and Flounder. 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 and crying, SpongeBob heads to his favorite restaurant with Pac-Man & the gang, Goofy Goober. There, he eats numerous sundaes with his friend Patrick Star, (which Pac-Man convinces him not to eat so he dosn't get sick wile Buster Bunny eats some ice cream too) 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, Pac-Man & the gang later arrives and SpongeBob 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 and Pac-Man are 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, Pac-Man and the gang do not complete his task. SpongeBob, Patrick, Pac-Man & then head off for Shell City in a car shaped like a Krabby Patty.
With his rival frozen solid, Plankton along with the Ghost monsters Blinky, Pinky, Inky, Clyde & Sue steal the Krabby Patty formula with ease. Meanwhile, SpongeBob, Patrick, Pac-Man and the gang 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, Pac-Man and the rest. Meanwhile, SpongeBob, Pac-Man and the gang 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 and the ghosts use mind-controlling buckets, disguised as souvenirs, to control the residents of Bikini Bottom, including Squidward, and renames the city Planktopolis.
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 SpongeBob and Patrick 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). Areal just thinks that Mermaid Magic is just a myth but she takes Mindy' s advice helpful to SpongeBob & Patrick. Singing a song, SpongeBob and Patrick with the rest 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, Patrick, Pac-Man and the gang 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, Pac-Man, Ms. Pac-Man, Buster & Babs are locked in a cage wile Ariel, Flounder, SpongeBob and Patrick find the crown, but encounter a lethal drying-out process which kills them. However, SpongeBob & Patrick 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. They quickly lock Pac-Man, Ms. Pac-Man, Buster & Babs out of the cgae before leaving. While the sea creatures attack the Cyclops, including a lobster who sprayed Elmer's glue onto him, SpongeBob and the gang 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 gang 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 and the ghosts eagerly watch. In the nick of time, SpongeBob, Patrick, Pac-Man and the gang 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. The ghosts start crying and then Pac-Man and Ms. Pac-Man and even SpongeBob chomps them.
Plankton is arrested and incarcerated wile the ghosts eyes head back to Pac-Land. Pac-Man and Ms. Pac-Man decide to head back to Pac-Land as well, and Buster & Babs head back to Acme Acres. 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.
In a post-credits scene, a theater usher tells the Captain and his pirate crew to leave.
Ariel, Flounder and Babs and Buster Bunny guest star in the film.