Throughout the 21st century, Earth was governed by the Buy n Large megacorporation (BnL), causing mass consumerism and covering the planet in trash by 2105. In an attempt to resolve the situation, Earth's population was evacuated on fully automated luxury BnL Starliners and Executive Starliners to spend five years on a cruise in space while an army of trash compactor robots named WALL-E were left behind to clean the planet. This plan failed, however, when in 2110 the planet was deemed too toxic to ever support life again, forcing humanity to remain in space indefinitely. Seven hundred years later, only one WALL-E unit still functions, having survived by salvaging parts for himself from his defunct brethren. This unit has developed sentience and a sense of emotion, particularly curiosity, as shown by his quirky habits, from collecting interesting items in the garbage, to domesticating a lone cockroach, to watching the film Hello, Dolly! and playing its show tunes. One night while viewing the film, he becomes fascinated by a scene with a man and a woman holding hands. From this he learns the concept of two life forms falling in love and conveying their feelings for one another through a simple gesture, and yearns to experience it himself.
The next day, a spaceship lands and deploys an advanced, feminine probe robot named EVE, with whom WALL-E falls in love at first sight. EVE, on the other hand, is hostile towards WALL-E at first, concerned only with fulfilling her directive of scanning for signs of plant life. When WALL-E musters the courage to introduce himself, though, EVE warms up to WALL-E and takes a liking to him after he brings her to his truck for shelter during a dust storm and shows her his knickknack collection. When WALL-E shows EVE a seedling plant he found earlier, EVE stores it inside herself and deactivates. WALL-E goes to great lengths to take care of her motionless body (and even takes her out on a date) in the fruitless hope she will awaken. When her ship returns to collect her, WALL-E desperately clings to the hull of the ship as it returns to the Axiom, flagship of the BnL Fleet.
As WALL-E follows EVE as she is taken to the bridge of the ship, it becomes apparent that after centuries of living in microgravity, consuming liquid food and relying on the machinery around them, humans have suffered severe bone loss, and have become extremely obese and unable to walk, reclining on hover chairs and communicating only through video messaging; even piloting the ship is handled by its computerized autopilot, AUTO, rather than the human Captain. On the bridge, EVE is reactivated and the Captain learns that once her plant sample is scanned by the ship's holo-detector, it will make an automatic jump into hyperspace back to Earth so humanity can recolonize the planet. However, when EVE is opened, the plant is found to be missing. EVE is deemed defective and sent to the robot repair ward with WALL-E, whom the Captain orders to be cleaned.
In the repair ward, WALL-E mistakes EVE's repairs for torture and tries to save her, only to accidentally release a horde of malfunctioning robots to roam the ship. As a result, WALL-E and EVE are designated "rogue robots" by security. Annoyed with WALL-E and his clumsy antics and thinking he stole and lost the plant, EVE tries to send him back to Earth on an escape pod. In the pod launch room, they see Auto's security assistant, GO-4, deposit the missing plant into an escape pod and set it to self-destruct. WALL-E sneaks into the pod to retrieve the plant as the pod is ejected, and narrowly escapes with the plant before the pod explodes. Overjoyed that both WALL-E and the plant are safe, EVE gives him a "kiss" in the form of an electric spark and shares a romantic spacewalk with him before returning the plant to the Captain.
The Captain replays EVE's visual recordings and sees that Earth is still devastated and nothing like the imagery of it he has seen. During the recording, EVE witnesses footage of her time spent with WALL-E in his truck as well as the scene of the lovers holding hands from WALL-E's favorite movie. Now possessing more sentience, EVE comes to understand love the same way WALL-E did. Further footage of WALL-E's painstaking and selfless dedication of protecting her while she was inactive causes EVE to finally understand his feelings for her, and she's so moved by his love that she realizes she loves him back. The Captain, meanwhile, comes to the conclusion that humanity must return to Earth to restore the planet. Auto, however, reveals that he was given a final directive from Earth seven hundred years ago to keep humanity in space, back when it was assumed that Earth would never be habitable. When the Captain resists, Auto stages a mutiny, electrocuting WALL-E, sending him and EVE down a garbage chute with the plant and confining the Captain to his quarters. In the ship's garbage depot, WALL-E and EVE barely avoid being jettisoned into space with the help of M-O, an obsessive-compulsive cleaning robot. EVE desperately tries in vain to repair the damaged WALL-E, as he now means more to her than her mission. However, WALL-E insists she carry out her directive, gesturing that she can repair him with the spare parts he keeps for himself in his truck back on Earth.