In the early 22nd century, the megacorporation "Buy n Large" assumed every economic service on Earth, including the government. Overrun by un-recycled waste, the planet became so polluted that it could no longer support life. Buy n Large CEO Shelby Forthright developed a plan that would have all humans spend the next five years aboard fully-automated luxury starliners, while an army of "WALL-E" robots would compact the waste into skyscraper-like towers for easy disposal. However, the plan largely failed, and thus Forthright had the starliners stay their courses until Earth was made habitable again. For the next 700 years humanity continued to live aboard the starliners for many generations. They increasingly relied on the machinery of the starliner for their every need and as time went by they became less and less physically active. 700 years later, the humans became too obese to do anything without the help of robotic assistance; even piloting the ships is handled by their individual computerized autopilots. On Earth, all of the WALL-E units have failed except for one; this remaining unit still performs his duties but, after centuries of prolonged activation, has achieved a form of sentience, collecting interesting knickknacks, befriending a cockroach, and watching an old videotape of Hello, Dolly! to learn about human emotions including love.
One day, WALL-E finds a new plant growth in the trash, and places it in an old shoe for safekeeping. Later, a spaceship lands on Earth and deploys a state-of-the-art "EVE" probe which begins to scan the soil as part of her directive to find plant life on Earth. While WALL-E falls in love with the new robot on first sight, EVE is much more concerned with fulfilling her mission, though she eventually warms up to WALL-E and takes to his unique personality. When WALL-E shows her the plant he found, EVE's automatic programming initiates, causing her to seize the plant and store it inside of herself, activate a homing beacon for her ship, and shut down. WALL-E is unable to awaken EVE, but goes to great lengths to protect her from the elements, as well as take her motionless body out on dates. EVE's spaceship later returns to collect her; WALL-E, unwilling to leave EVE, hitches onto the ship's hull to follow EVE to her destination, the Axiom, the flagship of the human starliners.
WALL-E realizes that EVE is part of the Axiom's programming to determine if the Earth is capable of supporting life; when the plant sample EVE carries is positively identified in the ship's holo-detector, the ship will return to Earth with its hyperjump engines, allowing humans to recolonize the planet. However, the ship's autopilot "Auto" had received a final directive from Forthright those hundreds of years ago, incorrectly asserting that Earth had become too toxic to ever support life, and told the autopilots to stay the course in space. Auto takes measures to stop the plant from being delivered to the holo-detector by attempting to destroy it, having one of the robots under his control secretly steal the plant from EVE while she is deactivated. When EVE reactivates, discovers WALL-E and finds the plant is missing, she thinks WALL-E took and lost the plant and becomes disillusioned with him, and is sent to the robot repair ward where WALL-E's clumsy antics get her into trouble. When she tries to send him back to Earth on an escape pod, they both witness the true thief deposit the plant into the pod and setting it to self-destruct. WALL-E safely retrieves the plant for EVE who, out of gratitude and relief of his and the plant's safety, gives him a gleeful hug. As their head touch, an electrical spark is exchanged (like a first kiss) and shares a dance with him in space around the ship.
WALL-E and EVE try to return the plant to the ship's Captain, but Auto prevents them from bringing the plant to the holo-detector. The Captain understands that the plant is living proof that life is again sustainable on Earth, as well as a sign that they have to return to Earth to make amends, but Auto does not and drops WALL-E and EVE down a garbage chute into the Axiom's waste chambers. WALL-E is significantly damaged, and the only parts that can save him are those he kept on Earth. EVE, having realized her true feelings for WALL-E after observing through her own security recordings the lengths he went to protect her while she was dormant, determines that the only way to return to Earth in time is to get the plant into the holo-detector and initiate the hyperjump. With the help of the humans and other robots, the two attempt to get the plant into the holo-detector, but are continually thwarted by Auto's control of the ship and security systems. The Captain manages to stand up on his own and deactivates Auto, allowing the plant to be placed in the holo-detector and sending the Axiom back to Earth, though WALL-E is damaged to an even greater extent in the process.
After the Axiom lands on Earth, EVE frantically attempts to repair WALL-E. Though she is able to restore his body, his memories and personality seem to have been erased, his waste-disposal programming taking over. EVE is heartbroken and mournfully gives WALL-E a farewell electric spark "kiss" that reboots WALL-E's memory. The two robots embrace happily as the humans from the Axiom take their first steps on Earth, carefully replanting the seedling that brought them back and begin working alongside the robots to restore their home.