Anne Shirley has now been married to Gilbert Blythe for 15 years, and the couple have six children: Jem, Walter, Nan, Di, Shirley, and Rilla.
After a holiday in Europe, Anne discovers that John Meredith, the new minister and a widower with four young children--Jerry, Faith, Una, and Carl--has arrived in the village. With only a dreamy father and an old, bitter, and partially-deaf aunt to take care of them, the children are not properly brought up. Because they play by themselves and never learn decorous behaviour, they are considered wild by many of the families in the village and thus Mr. Meredith's job and parenting skills are questioned. As only the Meredith children's scrapes are made public, they are misunderstood and their loyalty and kindness are for much of the book only seen by the Blythe children. They save an orphaned girl, Mary Vance, from starvation and Una finds a home for her with Miss Cornelia and Marshall Elliot.
The Merediths, Blythes, and Mary Vance like to play in a hollow called Rainbow Valley, which becomes a gathering place for the children in the book. Jem Blythe tries to help the Merediths learn to fit into society by forming the "Good-Conduct Club" - they punish themselves for misdeeds, something that leads to Carl becoming very ill with fever after a night in a graveyard, and Una fainting in church after they fast for a day. When this happens John Meredith is confronted by guilt over having abandoned his children, and he resolves to be a more attentive father.
Mr. Meredith is also having a second romance, with Rosemary West. Objections from Rosemary's sister, Ellen, about a promise they made years ago, have obstructed them. Finally the problem is resolved by the children, who find Ellen's long forgotten love, and the book has a happy ending with a double marriage.