After stopping off at Starbase Yorktown, a remote outpost on the fringes of Federation space, the USS Enterprise, halfway into their five-year mission, is destroyed by a powerful, unstoppable wave of unknown aliens. With the crew stranded on a unknown planet and with no apparent means of rescue, they find themselves in conflict with a new ruthless enemy who has a well-earned hatred of the Federation and what it stands for.
The film takes place two-and-a-half years into the characters' five-year mission, when the USS Enterprise is attacked by the "Swarm" and the crew is marooned on an unknown world as a consequence. They gain an ally in Sofia Boutella's alien warrior, "Jaylah".
Idris Elba plays the Swarm's leader, "Krall", who detests the Federation's philosophy and opposes its introduction to the wider galaxy. Elba said, "There's definitely an opposing argument to the good that the Federation think they do. There are purists that believe in independence, and believe that we're all made differently for a reason, and will fight tooth and nail to defend that. There’s massive relatability to modern world politics in that sense."
J.J. Abrams has stated he would like more female characters in the sequel. He also mentioned the sequel could fall back on abandoned story ideas for the characters. "There was [an idea] implying the sexuality of one of the characters, a back story for another character that was pretty intense, a really funny story we wanted to do with yet another. Hopefully, if there are future films, those other stories will get their moment," he said. Roberto Orci has voiced support for having a gay character.
William Shatner was contacted about a possible role in the film. Along with Shatner, Leonard Nimoy had been rumored to appear, in a scene with Chris Pine and Zachary Quinto, as the future alternate reality versions of the characters.  In the wake of Nimoy's death on 27 February2015, Simon Pegg mentioned there will be some tribute to the late actor in the final film. On 27 May2015, Pegg mentioned that it was possible Shatner could portray Kirk again at some point, but Shatner has confirmed he will not appear and he never discussed it. Shatner and Spock appear in the film in a still handled by the actor Zachary Quinto.
Zoë Saldana stated she would dislike it if Spock and Uhura broke up, describing that possibility as potentially "heartbreaking" for her. Concerning the film's action quotient, she speculated, "I'm pretty sure that for this third installment, we'll be able to sort of [...] be more hands-on." Lin said their relationship will be consistent and acknowledge what came before.
Bruce Greenwood has expressed hope that Christopher Pike could return, which he referred to as a "deep, deep wish to come back." Although Pike dies in Star Trek Into Darkness, Greenwood suspected Khan Noonien Singh's revitalizing blood could be used to bring Pike back to life. As a result, he confirmed, laughing, that he would be interested in reprising the role in "Star Trek III: The Search for Pike", an in-joke reference to the title of Star Trek III: The Search for Spock. In a serious manner, Greenwood related he would be interested in further resolution to the relationship between Pike and Kirk. (Star Trek Magazine Special 2015, p. 21) In reference to Kirk, he concluded, "Whatever happens in the third film, it will give the audience a sense of progression and change; an arc and a character that's really growing with them." (SciFiNow, issue 80, p. 26)