11-year-old Greg Heffley (Zachary Gordon) is anxious to start middle school. He lives with his mean older brother Rodrick (Devon Bostick), his mother Susan (Rachael Harris), his father Frank (Steve Zahn), and his younger brother Manny. Greg wants to become the most popular student at school, but he's worried that his childish best friend Rowley Jefferson (Robert Capron) will humiliate them both.
During their first day, Greg and Rowley re-encounter Greg's longtime nemesis Patty Farrell (Laine MacNeil), engage in a dangerous game called Gladiator during physical education class, meet a headstrong student named Angie (Chloe Grace Moretz), and from classmate Chirag Gupta (Karan Brar) learn of the Cheese Touch, a pandemic spread by touching a rotting slice of cheese on the basketball court.
Determined to become a class favorite in the yearbook, Greg joins the boys' wrestling team with Rowley. He's humiliated on the first day when loses to Fregley (Grayson Russell), the strangest student at school. He's even more humiliated when he loses to Patty, whose mother threatened to file a lawsuit against the school. The defeat is in the school paper, causing his popularity to plummet.
In an attempt to make Rowley more popular, Greg helps Rowley change his clothing choices, bike, and immature speech. On Halloween that night, the boys get in trouble when they anger a crew of teenagers by accidentally damaging their truck. Greg and Rowley manage to escape by running into the woods. Soon after, Greg attempts to become powerful in school by having himself and Rowley join the school safety patrol. While walking a group of kindergarteners home, the boys are almost spotted by the same teenagers.
During winter, Rowley fractures his arm due to an accident during a game the boys invented involving a bike and a football. As a result, Rowley starts to gain attention and become popular. Later, Greg has to walk the kindergarteners home alone due to Rowley not being able to get his cast wet. When he sees an approaching truck that's highly similar to the one that belongs to the teenagers, he attempts to hide by putting the kids into a ditch. As it turns out, the truck belongs to a middle-aged man, and Greg is spotted by a neighbor who thinks she is talking to Rowley due to Greg wearing his raincoat. As a result, Rowley is taken off safety patrol. Some time later, Greg decides to tell Rowley the truth, but Rowley, having come to realize Greg's foolish actions, storms off, ruining their friendship even more.
After Rowley befriends a student named Collin, Greg attempts to make him jealous by having a sleepover with Fregley. It ends with Greg spending some of the night in the bathroom after Fregley chases him with a booger on his finger. Frank picks him up afterwards. The next day, Greg tries to pursue popularity without Rowley by auditioning for the school play of The Wizard of Oz. Greg gets offered a part due to his lovely singing voice, but turns down the role of Dorothy Gale. He decides to be a tree, thinking he'll be able to throw apples at Patty, who's going to play Dorothy. The play goes wrong when Greg stops singing in fear of humiliation when Rodrick starts recording him, and Patty subsequently loses her temper with him and blames him for messing up the play, after which she, Greg, and the other students on stage engage in a fight with apples from the tree costumes. The play ends with Greg and Patty angrily tackling each other.
After being forced to attend a mother-son dance with his mother, Greg attempts to invite Rowley to get ice cream after the dance, but Rowley already has plans with Collin. Depressed, Greg returns to his mother and watches in horror as Rowley and his mom become the stars of the event by performing a dance routine to "Intergalactic."
One day during free time at school, Greg and Rowley get into an argument. As it escalates, the other students try to get the boys to fight each other. It quickly ends when the group of teenagers from Halloween night pull up to the school. Greg and Rowley are caught while the other students flee. The teenagers force Rowley to eat some of the rotting cheese on the basketball court. They then try to force Greg to do the same, but the teens flee the property when they are caught by the gym teacher. When the students go back outside, Greg covers for Rowley and says that he ate the cheese, which mends their friendship. Angie compliments Greg for his selfless act.
Sometime later, the school year has concluded. All the students receive their yearbooks, and Greg and Rowley make class favorites as "Cutest Friends."