John Mayer and Katy Perry
Katy Perry enlisted songwriter John Mayer to get back at Taylor Swift on recordGetty Images

American singer-songwriter John Mayer is allegedly helping Katy Perry write a song about his former girlfriend, Taylor Swift.

According to a report in Heat magazine, the 37-year-old singer convinced the Roar hitmaker not to attend the 2015 Billboard Music Awards, where the 25-year-old country crooner was the big winner of the night. She won eight awards at the event, including top Billboard 200 album, fan-voted Billboard chart achievement award and top artist.

"John convinced her it was a bad idea," a source said. "Katy realised she couldn't stand the idea of the cameras being on her face as she had to watch Taylor win every award with all her friends applauding her."

"Katy thinks revenge is a dish best served cold," the insider added. "She's even more determined to show people what she calls 'the real Taylor' − she's writing some big, anthemic-type songs that'll feature dirt on Taylor that John's told her from when they used to date."

"Katy's sure that she'll be back on top before long, and Taylor will regret ever starting this stupid row," the source added.

John Mayer and Taylor Swift
John Mayer and Taylor Swift briefly dated in 2009 and even co-wrote the song Half of My HeartGetty Images

Mayer and Swift briefly dated in 2009, and the two even co-wrote the song, Half of My Heart.

Following their split, the Red hitmaker wrote the song Dear John about him, which was released in 2010.

Swift and Perry, who have previously dated Mayer, were best friends for a long time before things got bad between the two.

In an interview with Rolling Stone magazine, Swift revealed that the song Bad Blood from her latest album 1989, is about a former friend. The two apparently fought over backup dancers.

Perry took a dig at Swift during the 2015 Super Bowl half-time show, which took place on 1 February at the University of Phoenix Stadium in Arizona.

During the performance, the 30-year-old singer's backup dancers wore high-waist polka dot bikinis, something similar to what Swift had worn while holidaying with Conor Kennedy on the shores of Hyannis Port, Massachusetts in 2012.