Timmy Turner makes his millionth wish which all of Fairy World has gathered to celebrate. But after reviewing his wishes, the Fairy Council finds that Timmy should be put on trial for being the worst godchild ever! Wanda, Cosmo, and Poof think they can prove that Timmy's a good kid, until the truth comes out — Timmy has made a secret wish that Wanda, Poof and everyone else did not know about besides Cosmo, who forgot he granted it.
Timmy is doing his last batch of wishes to reach a million, which include giant bacon, giant balls, a unicycle riding bear and his own team of groupies. But Timmy made a secret wish that himself and everyone else on Earth will stop aging. He made it so he can keep Cosmo, Wanda and Poof ever. Making what everyone thinks his millionth wish his actually millionth and first wish. Once the wish is made, Jorgen Von Strangle appears because he heard about the giant bacon. Not long after they all go to Fairy World to begin a celebration. Jorgen begins to sing the theme song, only to be shut down and have Timmy and his Fairies sing their own musical number, "A Million Wishes".
In Fairy World, there is a parade to celebrate all of Timmy's wishes. The first thousand showcase the fires he caused, the following thousands show hurricanes, floods, and some plagues. Jorgen assures Timmy that the Fairy Council is inspecting all of them only to make the parade balloons and that Timmy shouldn't worry. But Timmy is thrown into jail.
Timmy gets to have a trial on whether or not he is "the Worst Fairy Godkid Ever", but Cosmo is his lawyer, and to make matters worse, Foop is the prosecuting attorney. To top it off, Cosmo accidentally brought stacks of evidence against Timmy. Foop reasons that if Timmy loses then that means Poof would no longer exist because all of Timmy's wishes would have to be undone and he wants to see Timmy executed.
Wanda begins to call various witnesses to the stand, past wishes that were brought to life by Timmy. The first to be called is the Crimson Chin, who appears to have been in the middle of a bath when he is called as he is poofed into the room wearing nothing but his mask. He speaks in favor of Timmy at first, but then Foop shows the bad that Timmy caused to Crimson Chin, including turning his girlfriend evil and making him realize he is not actually real, Crimson Chin starts crying and says that he's taking a bath to wash away the sorrow of knowing he's just fiction.
Other wishes include Dark Laser, and Mark Chang. The Council decides to see all the good Timmy has done, which includes helping his mom win the Miss Dimmsdale contest to make her feel pretty, as well as the same thing for his dad. The most important wish however, is how Timmy wished Poof into existence. The council is brought to tears by this, and is about to rule in favor of Timmy, until Foop scrambles through Cosmo's stack of evidence and then finds a document labeled "Timmy's Secret Wish!".
As Foop reveals the document to the council, they explain that a secret wish is the ultimate violation of Fairy Law. They state that every wish must be accounted for; otherwise godchildren could secretly alter the very fabric of the universe, and Jorgen shows a clip about the last one made in December 19th, 1986 by a godchild named Joshua Applebee who secretly wished for Chuckles the Fairy Eating Cockatiel, which also caused massive destruction with its super powers, while telling about it. Timmy admits that he did made a secret wish and that he wished that Cosmo would forget granting it and he reveals what he secretly wished for (Wishing he would be 10 forever), forgetting to add Poof. When the council asked him when this wish was made, Timmy guessed he made it over fifty years ago.
Before the council makes all of Timmy's wishes undone, including Poof, Foop begins to celebrate, until Jorgen points out to him that as Poof's Anti-Fairy counterpart, which means if Poof disappears, he disappears as well. Just before Timmy was about to make what he does not know how he made his secret wish right, the council sends Cosmo and Wanda back to Fairy World while wiping their memories of Poof, though it is truly no thanks to Timmy. They call for Father Time and he nearly advances time on Earth and everything in it fifty years while he and the Council put their spells on Timmy as he is sent off home to sleep. Almost everyone on Earth is aged fifty years. Its places, including Dimmsdale, have now changed to resemble Jetsons-like futuristic types.
Timmy wakes up from his slumber, not sixty years old (but still roughly the same size) on his bed, living with his senile parents. Nobody in the world, not even Timmy, really knows or cares what's gone on, and they are all making their homes and artifacts blow up since the technology is beyond their understanding. Timmy also runs into Vicky, Chester, and A.J., all of them aged into senior citizens. Crocker is mostly affected because the trauma caused him on March 15, 1972 to prematurely age, and his normal appearance is not his elderly appearance, although he and Timmy constantly fall asleep.
Timmy remembers that Crocker obsesses about fairies, and Crocker recalls thinking Timmy has fairies. They go to the Crocker Cave to find answers, where Crocker reveals a portal to Fairy World which does not work because it keeps burning the test subjects. Timmy sees that the machine is simply set to the surface of the sun rather than Fairy World, and corrects the mistake, allowing him and Crocker to enter into Fairy World. They both spaz out (while drifting off to sleep in between) at the sight of fairies.
Crocker and Timmy find Cosmo and Wanda easily, as no fairy really seemed to be bothered that two humans were there. Once they reach their house Timmy makes Cosmo and Wanda remember that he is really himself, by guessing that Cosmo dresses like a princess and pretends to rule the bathroom when Wanda goes shopping, which was really their secret, and that they have a child, though Cosmo's memory is still fuzzy that he thinks Poof was a daughter that is square, green and named "Zeke", after he restores Timmy back to his ten year old self. They go confront Jorgen if they really have Poof as Zeke, and see that Jorgen has become morbidly obese and eating frosting because of the grief that undoing Poof caused to him. Jorgen explains that the council didn't allow him to tell Cosmo and Wanda about their kid, Poof, and he lamented that a lot. After a discussion, Jorgen reveals that there is a place where undone wishes go - the Hocus Poconos - and they can go there, but do not have much time.
In Hocus Poconos we see Poof, Foop, Crimson Chin and Dark Laser talking a little; Poof's magic is useless there. Once in, Jorgen shows that they have a small window of time to get out (represented by a literal closing window). Some gnomes with Scissor Hands are menacing Timmy's wishes, but Timmy and his companions come to the rescue with the bear and the cheerleaders from earlier in the episode. They save everyone with Crimson Chin's theme playing during the fight. The giant bird that was mentioned as the previous disaster Secret Wish before Timmy's shows up and blocks the exit window. In order to allow everyone else to escape, Timmy draws off the bird.
Shortly after appearing back in Fairy World, Cosmo, Wanda, Poof and the rest are brought before the Fairy Council, who are mad at them about going to Hocus Poconos and about to punish them. Wanda testifies on how Timmy sacrificed himself and how good he is. Foop tries to appeal to them by demanding a retrial of Timmy, but the Council denies it. Poof then just makes an argument, and it makes the council agree to save Timmy from the Hocus Poconos and begin his retrial. He explains that he made his secret wish so that he could forever have Cosmo, Wanda and Poof, now that he remembers to add him, and that it is because he cannot imagine life without them, he states that he does not care if he does not ever get to make another wish anymore, he begs just not to take them away from him and proclaims that they are his family, which is because it is about something more important than the wishes he made. Cosmo, Wanda and Poof then give Timmy a hug, which makes the Council cry happily together while hugging each other and overturn their previous court ruling, after proclaiming that he is not the Worst Fairy Godkid Ever, by allowing him to have his fairies back. They call for Father Time again and he sets time on Earth back fifty years, and everything and everyone on Earth is back to the way they were before Timmy made his secret wish. He then learns his lesson of how he should never make a secret wish ever again.