The opening scene shows Ted (voice of Seth MacFarlane) and Tami-Lynn (Jessica Barth) are getting married. Sam Jones (himself) is presiding over the nuptials. At the reception we find out that John (Marky Mark) is depressed because he got divorced from Lori six months ago. We also find out that Guy (Patrick Warburton) is dating Rick (Michael Dorn).
Ted does a dance sequence on a giant wedding cake over the opening credits.
One year later, the honeymoon is over for Ted and Tami-Lynn. Their bills are piling up and neither are making enough money as cashiers at the local grocery store to make ends meet. Teds mad that she spends so much money on clothes and Tami-Lynn is mad that Ted wastes so much money on weed.
Ted meets John at McFeltys Pub to complain. The bartender flirts with John, but hes just not interested. John goes into the bathroom and Ted tries to con a free drink out of her by promising not to tell anyone that Jay Leno hangs out there looking for gay bathroom sex. Just then, John rushes out of the bathroom followed by an apologizing Jay Leno.
Back at the grocery store, Liam Neeson (himself) stops in and asks if he can buy Trix cereal because the commercials have led him to believe theyre just for kids. Ted assures him its fine. Liam buys the cereal and leaves. A coworker named Joy suggests that Ted and Tami-Lynn have a kid to save their marriage because "having a baby makes white niggers" happy-pointing to a white family in the store. So, Ted proposes that to Tami-Lynn and they both agree that shed make a great mom.
John and Ted get stoned and watch Law & Order. Ted tells John his plan to have a kid. They decide that Sam Jones would be a great sperm donor because hes Flash Gordonalso, Ted is a teddy bear and doesnt have a dick, so he cant get Tami-Lynn pregnant himself.
Sam Jones cant be a donor because his sperm count is 1 on account of all the drugs he did in the 80s (up until earlier today, Id assume). On the way out, they accidentally break Sam Jones car window and bolt. They decide to get the next best thing to a super hero and devise a plan to steal Tom Bradys (himself) sperm.
John poses as an A/C repair man and cuts Bradys A/C. That night, Brady opens his bedroom door leading to his balcony to cool off. Ted and John break in to jerk off Tom Brady in his sleep and steal his sperm. Brady wakes up and throws them both out. While hiding, John tells Ted that hes hurt that Ted never asked him to be a donor.
They go to a fertility clinic so that John can donate. One of the doctors recognizes Ted from the news and shows him a room where sperm is stored for medical studies. John comes in and they start horsing around. Before you know it, John is on the ground coated in sperm samples. The doctor comes back and tells John that hes covered in rejected Sickle Cell samples. Ted says that he's covered in "more black guy jizz than a Kardashian."
Donny (Giovanni Ribisi) is now a janitor at Hasbro. He kisses up to an exec (John Carroll Lynch) by telling him that he changes the urinal cakes in his favorite urinal every day because a man that important shouldnt have to smell pee.
Tami-Lynn is barren because of all her drug use so the artificial insemination wont work. So she and Ted go to an adoption agency. Again, because of her drug use, they cant adopt. Also, more importantly, Ted is not legally recognized as a human. Hes an object, and the adoption process has raised some red flags.
Ted gets fired from his job because he's not a person. He also loses all of his credit cards and bank accounts. His and Tami-Lynn's marriage is annulled as well.
John says that they should get a lawyer to prove in court that Ted is a person.
The lawyer wont rep them for free, but offers the service of his niece who just passed the bar exam and will take the case pro bono. The niece Samantha Louise Jackson (Amanda Seyfried) takes the case. She's a 26 year old pot-head, but also a super smart lawyer.
We go through a lawyering montage where the three of them go through law book and start forming a friendship. Her strain of weed is called Get Me Home and it freaks out Johnny big time. After the montage, they watch Roots. During the Kunte Kinte/Tobe scene, Ted realizes that Kunta is just like him. Sam points out that if theyre able to get Ted legally recognized as a person, hell need a last name. He picks Clubber Lang. Sam has never seen Rocky. It becomes a running joke that shes completely unaware of all pop culture.
Back at Hasbro, Donny shows the Exec a newspaper article about Ted trying to become real. He says if they lose the case then Ted will just be property which they can steal, cut open and find out what makes him alive. Then Hasbro can mass produce Teds. The exec asks how much money Donny wants in return. Donny doesnt want money. He just wants his own Ted. So the exec says that theyll hire the best lawyer around Shep Wild (John Slattery) to fight Sam in court.
During the court case, both sides argue very well. Theres tons of TV coverage from Fox News to an SNL skit to jokes in Jimmy Kimmels monologue. Ultimately though, the jury finds Ted to not be legally a person. Sam says that its not over. She contacts Patrick Meighan (later to be revealed as Morgan Freeman) the best Civil Rights Attorney. He agrees to meet with the bunch in New York. Theyre banking on him being able to overturn the verdict.
To blow off steam, Sam, Ted and John go to an improve club and yell out sad suggestions to the performers like 9/11, Robin Williams, and Charlie Hebdo offices.
On the way to New York, the three stop at a diner. The waitress gives John fuck me eyes. Sam asks if she has "fuck me eyes". Ted says she has give us the ring, my precious eyes. Ted drives the next leg of the trip and crashes the car into the roof of a barn. They decide to stay there over night. They find that they're at a giant weed farm. Sam has a giant dick bong and neither Ted nor Johnny wants to hit it. She sings a song and plays a guitar they find. She and Johnny kiss.
The next morning they get the car down and head to New York. They find out that New York Comicon is going on at the same time when they almost hit Darth Vader, a Stormtrooper and a Jedi in the crosswalk.
Patrick Meighan meets with them and has ultimately decided not to take the case. He says that being a person also means being an inspiration, but Ted has done nothing inspiring. He could have too. He could have been an inspiration to the world, but instead hes a Justin Beiber. They leave.
Ted gets mad that nothing is working out for him and that Sam fucked up the case and Johnny doesnt care anymore because he's "porking Gollum". Sam doesn't know who Gollum is, so as Ted storms off, Johnny says that Gollum is a model.
Ted goes into Comicon and Donny follows. He runs into Guy and Rick, dressed like the Tick and Worf. They're there to fuck with nerds. Someone dressed as Raphael from the Teenage Mutant Ninja Turtles asks Ted for a picture. They go into a back stairwell and it turns out that the Turtle is Donny! They chase each other around for a bit. Ted steals a phone and calls Johnny to tell him whats happening. Donny chases him some more. Ted hides in a display of other Teds. Donny sings Sweet Caroline and Ted cant resist doing the bum bum bum part. Donny catches him and knocks him out. As hes carrying him away, he bumps into Guy and Rick who are still harassing nerds.
Johnny shows up and Guy tells him that Ted is with Donny. Before Johnny and Sam can rescue him, Sam Jones sees him and is pissed about his car window. A HUGE rumble of costumed characters breaks out.
Ted is duct taped to a table. Donny and the exec are ready to cut him open. Ted offers Donny a hand job while he eats ice cream which Donny considers. Eventually Johnny busts in and saves the day. The Exec takes off. When Sam asks who he is, he says he works for Mattel. Johnny punches Donny, knocking off his toupee.
Everyone is leaving, but Donny decides that if he cant have Ted, no one can. So he cuts the rope holding up a giant Starship Enterprise to kill Ted. Johnny sees it and jumps in to save his little Thunder Buddy. The Enterprise hits Johnny, throwing him across the room into a display case. Donny flees, but Teds able to find him hiding with a bunch of other Turtles by playing Tiffany on his phone. Donny cant help but to dance to it. Hes taken away.
Johnny is in the hospital in a coma. He starts to flatline and the doctors and nurses make Ted, Tami-Lynn and Sam leave while they work on him. In the morning, the doctor goes into the waiting room to tell them that Johnny didn't make it. They go in to pay their last respects. Sam cries. Ted cries and says that he doesnt how his life works without Johnny. Then.PSYCH! Johnny is alive and faking it. Sam is mad, but caves in quickly because thats what people do at the end of romantic comedies.
Patrick Meighan saw the footage of Johnny getting hit at Comicon to save Ted and decides to take the case since Ted inspired heroism in Johnny. He wins the case of course and all of Boston celebrates. Ted proposes to Tami-Lynn again and they adopt a kid who they name Apollo Creed Clubberlang. They get him a toy which looks like a tiny Ted.
In a post-credits scene, a battered Liam Neeson returns the Trix cereal to the store.