The students of Springfield Elementary go on a field trip to the Springfield Glacier which has nearly melted completely into a pond. Lisa blames global warming, although an incompetent ranger denies that global warming is real. Meanwhile, Homer and Marge visit Sprawl-Mart. Grampa is a greeter, and gets into an accident, telling Homer that he should take over for the moment. Eventually, the manager tells Homer that he can become the full-time greeter without chance for advancement, which Homer likes because there is no pressure.
Back at the glacier, Bart bullies Lisa because of the fact that she is enjoying an educational field trip. He previously tripped her on the school bus, then carved a message saying "Lisa stinks" on a rock in the exhibit. While Lisa lectures the other students about global warming, Bart steals two walkie-talkies from the ranger station then places one in Lisa's backpack, and spits into the other, making it sound like she is passing gas. Everyone teases her, and Bart goes as far as to throw a snowball at Lisa, causing her to fall into the freezing pond. Lisa becomes furious, and warns him that she will get revenge.
It turns out that the next morning, she has filed for and been granted a restraining order against Bart. He now cannot come within 20 feet of Lisa. Bart moves threateningly towards Lisa, which lands him in jail. In the next act, Homer contemplates over how to live with their kids apart. Chief Wiggum shows them a video guide about dealing with restraining orders hosted by Gary Busey. Homer makes a 20-foot pole out of various Sprawl-Mart items to make the order easy to enforce. He places the screwdriver at the end to "show Bart what it's like in the real world." Lisa quickly uses the pole to force Bart to be taught by Groundskeeper Willie in his tool shed. At lunch, while Lisa sits in comfort, Bart is out in the rain so he will not violate the restraining order. He needs to ride behind the school bus in a shopping cart. At the library, Lisa displaces Bart from the comics to the "Gay Interest" section, causing the bullies to laugh at him. Dr. Hibbert diagnoses that Bart has suffered extensive nerve damage and, must be injected with an "anti poking potion". Dr. Hibbert implies that he is distracted by a sexual harassment lawsuit, as he repeatedly misses the vein, only hurting Bart even more. Back at Sprawl-Mart, Lisa enjoys eating in the cafeteria with Homer, especially without Bart. The manager tells Homer that if he does not work overtime without a bonus, he will be shipped back to Mexico, having made up a fake ID card for him. Marge then decides to get an appeal for lifting the restraining order. During the trial, Bart insults Judge Harm by stating that Lisa has no sense of humor and Judge Harm never got married--and when she angrily says she IS married, Bart wonders if her husband is "blind and deaf"--leading Judge Harm to expand the order so that Bart must remain 200 feet from Lisa.
Now, Bart has to camp out in the backyard. He then realizes that he can live the natural way. He takes his shirt, shoes and socks off, runs around, can urinate anywhere, and plays around with wild dogs. Watching him through binoculars, Marge suggests to Lisa that she may have gone too far. Lisa responds that Bart has not done nice things for her, but promises to destroy the order. Back at Sprawl-Mart, Homer and his co-workers are locked in late at night, with a chip implanted in the back of Homer's neck, but he removes it and joins his co-workers in robbing the store by using a forklift to steal several plasma TVs. When Bart builds a statue of Lisa, she is impressed. When she finds out that it was going to be burned, and Bart lies about why, Lisa says how she misses Bart's lies. She burns the restraining order and the poke pole, while the family reunites, playing Tijuana Taxi.