Rainbow RocksAt Canterlot High, the school is preparing for its annual charity musical showcase, where various student groups will perform. Rainbow Dash leads her friends Applejack, Fluttershy, Pinkie Pie and Rarity in their band, the Rainbooms, after recently realizing their common musical skills, as well as the fact that when they play together, they temporarily transform as they did when they defeated the demon form of Sunset Shimmer from My Little Pony: Equestria Girls. Sunset, who has become friends with the five and encourages the band, still struggles with getting the rest of the school to accept her.
To help improve her reputation, Sunset offers to introduce three new girls to the school: Adagio Dazzle, Aria Blaze, and Sonata Dusk. She finds the trio strange, particularly the red jewels they each wear, and disinterested in the school's facilities, until she reveals they are about to hold the musical concert. After completing the tour, she joins the Rainbooms at the cafeteria and expresses her concern with the new girls, when suddenly the three enter the cafeteria singing an alluring song. As Sunset and her friends watch, Adagio, Aria, and Sonata appear to set the various bands against each other through their singing, feeding off the discord they are creating, and prompt the student body to turn the musical concert into a Battle of the Bands.
Sunset and the Rainbooms go to Principals Celestia and Luna, but find that the trio — now calling themselves the Dazzlings — have already been there first and put the adults under the same spell, allowing the Battle of the Bands to continue. Sunset and her friends suspect that there might be magic involved, and wish they could talk to Twilight Sparkle for advice, but know the portal to Equestia is still closed for a long time. Sunset suddenly remembers one of the few possessions she kept from her Equestrian past — a book that is linked to a similar one in Princess Celestia's library, that by writing in her book, the writing would appear in the other copy, thus providing a way to contact Twilight. After a bit of hesitation, Sunsets writes out her message.
In Equestria, Twilight and her friends are getting acclimated to her new castle. A fresh delivery of books from Canterlot arrives, with one of the books — the companion to Sunset's book — starts vibrating. Twilight and the others read Sunset's message for help, and Twilight deduces that the Dazzlings are really Sirens from Equestria, whose singing would create hatred and jealously between the peaceful ponies that they fed off of, and as such, the Sirens had been banished from Equestria long ago by Star Swirl the Bearded. Knowing that her human friends will need her help, Twilight uses the magic of the book and power drawn from the castle to allow the mirror to be opened at any time. Twilight's friends offer to come along, but Twilight warns of the confusion of having duplicates of her friends around, and soon she and Spike set off through the portal.
Twilight's friends are waiting for them when they arrive, and they share a few moments to catch up with each other. Twilight then explains the Sirens, and figures they can defeat them the same way they did the demonic form of Sunset, by using the magic of friendship. At the signups for the Battle, Twilight and the others step into the center of the gym, lock hands, and prepare to unleash their power at the Dazzlings.
Realizing something is wrong, Twilight, Sunset, and the Rainbooms meekly run off, but Adagio recognizes that the group is not affected by their song, and sense that they are protected by Equestrian magic. She tells Aria and Sonata that if they can make the Rainbooms turn on each other, they will feed on what they have been missing for years, and the three set about to set the other bands against the Rainbooms.
Twilight tries to figure out what went wrong, coming to the conclusion that they need to use a musical counterspell against the Dazzlings. The Battle of the Bands would provide the perfect opportunity, but Twilight needs to come up with a song first. Pinkie Pie offers Twilight and the others to a slumber party at her place as to avoid having Twilight sleep in the library again. Though the sleepover is fun, Twilight struggles to come up with a spell. She and Sunset bond over realizing they have both been in the same place, a position where everyone is expecting them to find the answer.
The next day, the Rainbooms practice Twilight's first attempt at the song, which neither works well nor sounds well. The Rainbooms change their plan, that instead of using that song at the first round, they'll simply continue to win other rounds as to give Twilight more time to complete a proper counterspell, making sure not to play so well as to reveal their magical transformations before it is time. As the Battle of the Bands begin, the Dazzlings' spell causes the other bands to try to sabotage the Rainbooms' performance. They manage to complete their song, but this starts the group in-fighting with each other over minor issues that Sunset has seen before. She assures the group they will be better in future rounds. She is later accosted by the Dazzlings, who know all about her past at Canterlot High and how the rest of the student body resents her, taunting her that she won't be able to stop their own plan.
The Rainbooms reach the semi-final round, going up against Trixie and her band, the Illusions, while the Dazzlings have secured their place in the finale. Twilight still hasn't finished her spell, so Rainbow Dash suggests one of the songs she wrote to play, an arrogant piece that is all about her own awesomeness. Forgetting the need to play it cool, Rainbow's over-the-top antics while playing start to trigger her transformation, and Sunset lacking other options, flying-tackles her off stage, quickly ending the song. This not only sets the student body against Sunset, believing that she wanted the spotlight, but also the Rainbooms. When it comes to deciding the winner between the Rainbooms and the Illusions, the Dazzlings use their spell to trick Celestia and Luna to vote for the Rainbooms, despite the poor performance. This enrages Trixie, which is exactly what Adagio wanted, as she tells Trixie that if somehow the Rainbooms didn't happen to show up for the final round, the Illusions would take their place by default.
As Twilight races to finalize the counterspell and the Rainbooms practice at the school's outdoor stage, Trixie accosts the group, and then opens a trap door on stage, which causes Twilight, Sunset, and the Rainbooms to fall into; Spike, off playing with a chew toy, realizes the danger and runs off to find help. Trapped beneath the stage as the final round begins, the Rainbooms start to bicker among each other, and Sunset recognizes what has been happening, that the Dazzlings are feeding off the anger that the Rainbooms show for each other. Twilight realizes the same thing, and concludes that they don't need any specific counterspell, but simply to play together as a group of friends. The group quickly makes up with each other, and then attempt to escape, when Spike arrives with help - Vinyl Scratch, whose headphones have protected her from falling under the Dazzling's spell.
On stage, the Dazzlings have begun their final song, readily feeding off the school body's emotions. The Rainbooms arrive on a hillside across from the stage, and with the help of Vinyl's car-turned-stage-system, they start to play back at the Dazzlings, and soon they gain their pony transformations. Adagio, momentarily confused by this, insists that now the real battle of the bands will start, and the Dazzlings themselves have their own pony-like transformations, allowing them to unleash their hippocampi-like siren forms to attack the Rainbooms. The Rainbooms fight back with the power of their music, but even this is not powerful enough when all three Dazzlings sing at full volume at them. The Rainbooms are thrown back, Twilight's microphone flying to Sunset's feet. She frets, but when encouraged by Twilight, Sunset picks up the mic and proceeds to start singing. The rest of the Rainbooms join in, and with Sunset's addition, they are able to push back the Dazzlings. Suddenly, Sunset undergoes her own pony transformation, and with the seven friends' combined powers, they create a giant alicorn avatar in the sky that blasts away the hippocampi siren forms, and destroy the red gems the Dazzlings wore. As the spells dissipate, the Dazzlings attempt to sing, but without the help of their gems, their singing is very atonal, and they run off amid a wave of boos from the school audience, along with a good Produce Pelting.
With the Dazzlings' spell broken, they realize that Twilight will be going back to Equestria soon. Rainbow offers Sunset the option to be a backup singer to take Twilight's place in the band, but Sunset shows how good of a guitar player she is. The next day, as they gather by the portal, Twilight explains that because of what she did with the book and mirror, she'll be able to return any time she's needed, and they say their goodbyes before departing. Later, as the Rainbooms prepare to practice, Sunset writes to Twilight in her book, hoping to learn more friendship lessons from her.
In the movie's post-credits stinger, a lab coated-figure is examining data pointing to strange activities at Canterlot High. This figure turns out to be the real human Twilight Sparkle, along with a very-non-dragon Spike the dog.