The movie opens with Ralph Wiggum singing along to the 20th Century Fox logo. We then cut to Itchy & Scratchy: The Movie. They are out on the moon. Itchy kills Scratchy and then returns to earth and is painted as a hero by the media. Shortly thereafter, Itchy is elected president. Later as Itchy is in the White House, he sees a supposedly dead Scratchy on the moon. Scratchy holds up a sign that says "I'm telling", which freaks President Itchy out. Itchy then retaliates by sending a hundred missiles toward Scratchy. This is then seen in the theater which is being attended by the Simpsons. Homer stands up and yells "Boring!". Lisa replies "Dad, we can't see the movie!". Homer then goes off on a tirade about why they're paying to watch something in the theater that they normally watch on TV, and that everyone in the audience is a gigantic sucker, especially you. Cue a very fancy and stylized version of the standard Simpsons opening theme.
The opening ends with Green Day hosting a concert at Lake Springfield (Singing the Simpsons theme after the opening credits). After they finish their song, they talk about the environment. The audience becomes angry and begins to throw garbage at them polluting the lake and causing their barge to dissolve and sink, killing them. The next day at church, while they have a short memorial for Green Day, Grampa is possessed by God warns the city of a future disaster. Marge believes Grampa's prediction, and decides to work out the meaning of the message. Meanwhile, Lisa starts to talk about the environment, with no success. She encounters Colin, an Irish boy who shares the same passions as her. Homer gets a note from Marge of his chores, and one is fixing the sinkhole. Instead of fixing it, Homer puts Maggie's sandbox over it. His next chore is to fix the roof. While repairing the roof, Homer and Bart decide to have a dare contest. Homer dares Bart to climb the antenna. Bart does so, and gets stuck. Homer shakes it in order to get Bart down. Homer dares Bart to skateboard to Krusty Burger naked, which Bart object's to, saying girls will see his "doodle". After Homer threatens to call him chicken for the rest of his life, Bart agrees. Bart becomes stuck naked on the window of the building. After he is apprehended by the police, and tied to a Stop sign pole, Homer turns up and they decide to order a meal, he brings him socks and a shirt, and no pants. Inside the restuarant, Ned Flanders helps Bart out by giving him a pair of pants, and understands his feelings which begins a relationship and mutual respect between the two. Meanwhile Krusty is filming a commercial. When recording finishes Krusty orders for the pig he is using in the commercial to be slaughtered, causing it to flee to Homer who adopts him, and calls him Spider-Pig. That evening Lisa holds a conference at city hall, called "An Irritating Truth" and explains that the town lake cannot sustain anymore pollution. Mayor Quimby declares a state of emergency and orders the cleansing and protection of Lake Springfield.
They put up a fence around the lake to halt further dumping, and announce it is idiot proof, using Cletus as an example to try to throw a possum in the lake, and fail. Soon, Marge asks Homer where "Spider-Pig's/Harry Plopper's" waste is going. Homer shows her an overflowing silo, asking how a pig can fill it up in two days, Homer replies that he helped, horrifying Marge who tells Homer to dispose of it safely. While waiting in a queue at the dump Homer is told by Lenny that Lard Lad Donuts has been shut down and that they are giving away free donuts. Homer, in his haste to get to the giveaway decides on a quicker means of disposal and dumps the silo into the lake, causing it to become heavily polluted. A nearby squirrel jumps into it and becomes severely mutated, with many eyes. Nearby, Bart and Flanders are hiking up a hill when they discover the squirrel who is immediately captured by the EPA. At the White House, the contained squirrel is brought before President Arnold Schwarzenegger by Russ Cargill, head of the EPA. He states that Springfield has become so polluted that the government must take drastic action and proposes five different solutions. The President picks plan 3 at random, choosing to not even read them, which leads to a giant glass dome being placed over Springfield. Cargill then tells the town that Springfield is now the most polluted city on the Earth and that the government has decided to contain it. The next day, Maggie falls through a sinkhole in her sandbox and emerges outside the dome, before returning. The police reveal that Homer polluted the lake and an angry mob approaches the Simpson's house and torches it. The family escape through the sink hole, which expands destroying their house. The family flee, and whilst hiding in a dilapidated motel Homer reveals that he has always kept a backup plan in the event that they are run out of town. He proposes that the entire family move to Alaska, a plan that Marge eventually agrees to. The next day the family attend a carnival where Homer enters the "Ball of Death" challenge, a spherical cage in which he must ride a motorcycle around in a full vertical circle. He wins a truck and the family move to Alaska, and begin to enjoy their new life.
Back in Springfield, the townspeople attempt to break the dome. Russ Cargill tells the President that they can't keep Springfield in this state forever and presents five new solutions. Again Schwarzenegger tries to randomly choose a plan, but this time he is lead by Cargill to choose the plan to destroy Springfield. Back in Alaska, the family sees an advert presented by Tom Hanks promoting a new Grand Canyon, to be located where Springfield is. Marge and the kids decide that they must save Springfield, but Homer refuses to help the town that tried to kill him. Later that night after returning home from the local bar, Eski-Moe's, Homer discovers a video tape left on the bed, which is a pre-recorded message from Marge telling him that they have left. She is so determined to save the town that she is prepared to end her life with Homer. Homer becomes frantic and starts looking for Marge, but falls asleep in the middle of the snow. The next morning a polar bear tries to attack him but a mysterious person dressed in Native American clothing wards it off and drags Homer to her tent. When he is revived the stranger, revealed to be a woman with enormously sized breasts, tells him that he must reach an epiphany or he is doomed to spend the remainder of his days alone. He soon has a mysterious vision where he is tortured by a forest of trees and reaches an epiphany. He thanks the lady, and sets off to find the family. On a train, Marge tells the kids that they must reach Seattle and warn everyone about the plot to destroy Springfield, however, they're overheard by the NSA and are captured by Cargill.
Homer meanwhile is struggling on his journey, when "Boob Lady" (the native woman) appears in the sky and points him in the right direction with her gigantic breasts. He approaches a spot where he can survey the city and finds that the EPA have set up a compound around the dome. He hears a noise and tells Lisa to stop playing her saxophone, he then realizes that they are in a nearby EPA van and uses a parked bulldozer to attempt to free them, which fails, resulting in him being crushed by the wrecking ball. The van moves on and the agitated occupants are gassed to sleep. They awake to find themselves in a practically destroyed Springfield and are told that the town went crazy and destroyed everything. Cargill appears on the giant screen once again and tells the town that they are going to be killed and Springfield completely destroyed. A helicopter arrives and opens a hole at the top of the dome before lowering a bomb on a rope, Cargill remains onscreen to oversee the countdown. Outside the dome Homer knocks out the guard and locates some superglue, right next to a jetpack, in a nearby hut. He begins to climb to dome with his now sticky hands. Back inside the dome, the townspeople are fruitlessly attempting to disarm the bomb and eventually decide on a diversion. Cletus Spuckler distracts Cargill while the rest of the town climb up the rope and escape through the hole. Homer makes it to the top of the dome and slides down the rope, knocking everyone and the bomb off of it, accidentally halving the detonation time in the process. In desperation, Homer notices a motorcycle and realizes what he must do. Meanwhile Bart is at the church, as he has decided he wants his last moments to be with Ned whom he has adopted as a father-figure. Homer shows up at the church with the bomb and eventually convinces Bart to accompany him. They motorcycle up the side of the dome and Bart throws the bomb through the hole, blowing it up and shattering the dome. Krusty announces no one got hurt, until a giant piece of the dome crushes Dr. Nick Riviera, killing him. Homer and Bart land the bike at Springfield Gorge, where they encounter Cargill wielding a shotgun. As he prepares to shoot them, Maggie crushes him with a boulder. The town praise Homer, and Collin takes Lisa for some Ice Cream, Homer takes Marge on a ride on the motorcycle, and they soon rebuild Springfield and the Simpson's house.
During the credits, Mr. Burns and Smithers are sitting in Mr. Burns' unusually empty house. Smithers says "They've taken everything sir.". Burns replies "Smithers, I don't believe in suicide, but if you would like to try it, I would certainly watch.". Later, the Simpsons are shown sitting in the cinema and decide to leave. Then Lisa notices Maggie is going to say her first word - "Sequel". Further post credits show the zit-faced clerk mopping up the movie theater and saying "Four years of film school for this?".