Barney's Adventures of Toy Story 3 is the sequel to Barney's Adventures of Toy Story and Barney's Adventures of Toy Story 2, and a Barney/Pixar crossover film to appear on YouTube in the nearby future.
Andy, now 17 years old, is leaving for college, and his toys have not been played with for years. Barney is there wish them luck what Andy plans to do with them all. When Andy comes back, he intends to take only Woody with him to college, and puts Buzz Lightyear, Jessie and the remaining toys in a bag to be stored in the attic. Andy's mother mistakenly takes the bag to the curb for garbage pickup. The toys escape and, believing Andy intended to throw them away, decide to climb in a donation box with Barbie bound for Sunnyside Daycare. Woody follows them and tries to explain the mistake, but they refuse to believe him.
Barney and Andy's toys are welcomed by the other toys at Sunnyside, and are given a tour of the seemingly perfect play-setting by Lots-O'-Huggin' Bear (simply known as Lotso), Big Baby, and Ken, with whom Barbie falls in love, which is normal for the Barbie franchise. All of the toys choose to stay, except Barney and Woody, who attempt to return Woody to Andy. Woody is found by one of Barney's kid friends, Bonnie, one of the Sunnyside children whose mother works there. She takes him home and plays with him along with her other toys, which are well-treated. At Sunnyside, however, a group of toddlers roughly play with Andy's toys.
Buzz decides to ask Lotso to have them moved to the older children's room, but is captured. Lotso, who controls Sunnyside with an iron fist, reveals he sends new toys to distract the toddlers to keep him and his henchmen safe, not caring whether the toys get broken in the process. Seeing promise in Buzz, he resets him to his original space ranger persona, wiping his memory. At the same time, Mrs. Potato Head (who accidentally left one of her eyes at Andy's house) sees Andy searching for the toys and convinces the toys that Woody told the truth. Before they can leave, Andy's toys are imprisoned by Lotso's gang.
At Bonnie's house, before Barney and Woody leave to find Andy, they learn from a toy clown named Chuckles that he, Lotso and Big Baby once had a beloved owner named Daisy. When the toys were accidentally left behind by Daisy's family during a trip, they made their way back to her house, only to find that Lotso had been replaced with an identical toy, causing Lotso to become embittered.
Woody and Barney return to Sunnyside and reconcile with their friends. That night, the toys attempt to escape, and accidentally reset Buzz to Spanish mode instead of his original persona. However, Buzz allies himself with the guys and falls in love with Jessie. The toys reach a dumpster, but are caught by Lotso and his gang. As a garbage truck approaches, Woody reveals what he learned about Lotso. Lotso says that he now believes toys are meant to be thrown away, leading an enraged Big Baby to throw Lotso into the dumpster. Lotso pulls Woody into the dumpster just as the truck collects the trash. Woody's friends fall into the back of the truck while trying to rescue him, and a falling television hits Buzz, restoring his memory and normal persona.
The truck deposits the toys at a dump, where they find themselves on a conveyor belt leading to an incinerator. Woody and Buzz help Lotso reach an emergency stop button, only for Lotso to abandon them. Believing the end is near, the toys accept their fate, but are rescued by the Aliens operating an industrial claw. Lotso escapes, but a garbage truck driver finds him and straps him to his truck's radiator grill. Woody and his friends board another garbage truck, driven by an adult Sid Phillips, back to Andy's house. Barney leaves them again, wishing them luck all over again.
In Andy's room, Woody climbs into the box with Andy's college supplies, while the other toys ready themselves for the attic. Woody leaves a note for Andy and Andy, thinking the note is from his mother, takes them to Bonnie's house and introduces her to his old toys. Bonnie recognizes Woody who, to Andy's surprise, is at the bottom of the box. Though reluctant, Andy passes him on to Bonnie, and then plays with her before leaving. Woody and his friends watch Andy's departure before beginning their new lives with Bonnie.
During the credits, Woody and the other toys learn that Barbie, Ken and Big Baby have improved the lives of the toys at Sunnyside.