SpongeBob and Patrick are lying on the ground and watch the clouds until they see a haunted houseboat crashing to ground near them. Patrick wants to check it out but SpongeBob says that it looks dangerous. Patrick soon convinces SpongeBob to come with him, so the friends went to go check it out. Patrick thinks the boat is lame, but SpongeBob thinks it is real. SpongeBob looks at a painting of flowers that is in the boat and states that it is pretty but soon the flowers turn into snakes and hiss at SpongeBob which makes him panic.
Then, they meet Lord Poltergeist (who Patrick thinks is a robot that serves pizza). Lord Poltergeist says that he will sing a sea shanty to make SpongeBob and Patrick believe he is a real ghost. At the end of the song, Patrick says he wants pizza so he gives him pizza that has anchovies on it which scares them out of their wits. SpongeBob asks why Lord Poltergeist is in Bikini Bottom and it is because there is a broken head gasket. Lord Poltergeist takes their souls but gives SpongeBob a doubloon to buy a new head gasket. He says that if they do not return with a new head gasket in 24 hours, their souls will be gone forever.
SpongeBob and Patrick run to the Krusty Krab and tell the customers about the ghosts, which freaks them out and causes them to flee. Mr. Krabs wants to know what is with the chaos. SpongeBob tells Mr. Krabs about how Lord Poltergeist stole their souls and gave them a doubloon to buy a head gasket. Mr. Krabs takes the doubloon and takes a head gasket from a boat that is outside the Krusty Krab. Mr. Krabs forces Squidward to come along with them to find the ghosts and steal their treasure. Sandy then appears with ghost equipment, claiming she was looking for "milkshake gremlins" and wants to catch some ghosts.
The five go back to the boat where Lord Poltergeist was seen. Mr. Krabs steals the doubloons and hands bags of them to Squidward and Patrick. Mr. Krabs then sees a doubloon that is stuck to the bottom of the chest. He tries to pull it out but ends up setting off a trap which causes Lord Poltergeist to appear. SpongeBob gives him the head gasket and the lord gives SpongeBob and Patrick orange soda instead of their souls and reveals that he never took their souls in the first place. He sucks Mr. Krabs, Squidward and Patrick (who are trying to escape with the gold) into a void, and shows them their greatest fears. First, Mr. Krabs has to use the restroom and finds a portable bathroom, but to use it, he must pay one doubloon. Next, Patrick wishes for a doughnut and then a talking one comes up on his head that Patrick annoys. He wishes for a doughnut with sprinkles, then chocolate, then a bagel, then a stack of pancakes, oblivious to the fact that he had outsmarted his worst nightmare, something Lord Poltergeist intended to be impossible. He then asks for a Krabby Patty, and then another plain doughnut, much to the doughnut's annoyance. Finally, Squidward encounters a giant SpongeBob, which makes him scream. Sandy sucks the three back into her ghost hunting equipment. Then, Mr. Krabs and Lord Poltergeist fight for the chest of doubloons. They fling it into the air and SpongeBob catches it and sees a "Property of the Flying Dutchman" stamp at the bottom of the chest followed by a phone number. The Flying Dutchman comes by to reclaim his doubloons (but ends up being tricked by Lord Poltergeist that they were looking for him to give him back the gold). Lord Poltergeist runs away until the boat breaks down. Finally, the Flying Dutchman turns into a torpedo that makes a huge void that sucks everyone inside. The episode finishes with the Krusty Krab in the void with new workers and customers. When SpongeBob tells everyone to hold on to something, he tells Giant Demonic SpongeBob from the void to flip the restaurant. He does so, and then his face turns into The Flying Dutchman's and he laughs evilly.
The title card is similar to "Big Sister Sam," except it is in black and white.
This is the first episode of the series since "One Krabs Trash" with the 1986 Paramount logo, but with the 2010 Viacom byline. This variant was taken from the movie Paranormal Activity 3 which came out around the same time of this episode in 2011.
This is the second episode where a character's name wasn't said in the episode, but was revealed in the credits. In this episode, it was Lord Poltergeist. The first time was Squidette from "Squidville."