As Greg Heffley is getting ready for his first day of middle school, he is teased by his teenage brother Rodrick, because his mom bought him his supplies for school. He has a little brother, a toddler named Manny, who is "spoiled rotten" because he gets everything he wants and also gets away with everything he does wrong. His father, named Frank Heffley, does not encourage Greg's way of life - playing video games all day - rather than going outside and playing sports.
During the first day of school, Greg is immediately rejected and is forced to sit with another outcast named Fregley, from whom Greg tries to keep "a safe distance". He is initially unsure whether his best friend Rowley Jefferson will be able to fit in, as he considers Rowley to be immature. However, Greg strongly believes that he can become popular. He and Rowley decide to take part in wrestling at school, although Greg quits after losing a match against Fregley.
On Halloween, Greg and Rowley go trick-or-treating, but are challenged by teens who spray Greg and Rowley with a water-filled fire extinguisher. Greg tries to threaten them by saying he's going to call the police, but the teenagers start to chase them. The two friends escape and go to Greg's grandmother's house until the teens leave.
After getting few presents for Christmas, Greg decides to play a game with Rowley in which Rowley must ride a bike while Greg tries to knock him off. On one of Greg's tries, the ball gets under the front wheel, which causes Rowley to fall off and break his arm. When Rowley goes to school with a plaster cast, the girls take care of him (carrying his books, feeding him food) which makes Greg jealous. After Rowley's arm heals, he and Greg decide to enroll in the safety patrol program in which they walk younger kids to their homes.
One day, as Greg is walking the kids by himself he chases the young children after scaring them with a stick with worms on it. A neighbour contacts the school and tells them about Greg's unusual behavior. The principal suspects Rowley, as Greg was wearing Rowley's jacket. Rowley is suspended from the safety patrol. Greg later decides to confess the truth, but Rowley has already informed on him, resulting in their friendship breaking off.
Greg tries to befriend Fregley to make Rowley jealous, although he is uncomfortable around Fregley. Resorting to auditioning for the school play (based on The Wizard of Oz) Greg lands the role as a tree, while Patty Farrel is cast as Dorothy, the protagonist of the novel. During the show's opening performance, Rodrick brings a camera to film the play. Greg becomes too nervous to sing, confusing the other "trees" who also fail to sing. Patty gets frustrated and angers Greg, who throws props at Patty, and then everyone gets in the fight, ending the play in chaos.
Feeling desolate from being blatantly rejected by everyone, Greg is surprised and a little happy to see Rowley approaching him at recess, until, he discovers that he's only there to demand back a CD he'd left with Greg. They get into an awkward fist-fight. While they are fighting, the teens who chased them at halloween are drawn to the chaos crowding around Greg and Rowley tumbling around in the dirt. When the leader of the teen gang scares away the rest of the students, they force Greg and Rowley to eat a moldy piece of cheese that has been left on the school grounds for years. Rowley is the first to eat the cheese - except when it comes to Greg's turn, he claims that he's lactose intolerant and that eating cheese will kill him. The principal turns up and the teens disappear. The other students see the cheese in front of Rowley and believe he has eaten from it. Greg takes the blame and claims he ate the cheese. Greg and Rowley mend their friendship.