A production of Shrek: The Musical has undergone a script edit after audience members complained about a transphobic slur.

The Big Bad Wolf is called a “tranny” and mocked for cross-dressing throughout the family-friendly performance currently running in Halifax, Canada.

One transgender man present at the show, Ky Greyson, was offended by the “very dehumanising jokes with regards to not conforming to gender roles”. The 20-year-old walked out and later contacted the Neptune Theatre’s general manager to explain why “the comedy [of such jokes] hurts so much”.

“If we’re teaching kids in the audience that this is to be mocked, to be ridiculed, we’re perpetuating self-hate in people who may be trans women or trans feminine people at a young age and also continuing this myth and understanding of what trans people are,” Greyson told CBC News.

“It was a really good production but I remember hearing the word used and the entire crowd bursting out laughing and just my heart dropping.”

Shrek: The Musical, here performed at the Theatre Royal in London

Jennie King, a spokeswoman for Neptune Theatre, released a statement confirming that any derogatory references had been removed.

“We were upset to learn that one of our productions created a feeling of distress among members of the LGBTQ community in Halifax and changes were made immediately to remove content once we became aware of the situation,” it read.

“Neptune has spoken and met with these members of the LGBTQ community to express our apologies and to learn from this experience.”

People who made 2015 a landmark year for LGBT rights Show all 10 1 /10 People who made 2015 a landmark year for LGBT rights People who made 2015 a landmark year for LGBT rights Caitlyn Jenner People who made 2015 a landmark year for LGBT rights Miley Cyrus Getty People who made 2015 a landmark year for LGBT rights Kristen Stewart People who made 2015 a landmark year for LGBT rights Cara Delevingne People who made 2015 a landmark year for LGBT rights Keegan Hirst People who made 2015 a landmark year for LGBT rights Ruby Rose People who made 2015 a landmark year for LGBT rights St Vincent (who's in a relationship with Cara Delevingne) People who made 2015 a landmark year for LGBT rights Annie Lennox People who made 2015 a landmark year for LGBT rights Ellen Page People who made 2015 a landmark year for LGBT rights Justice Anthony Kennedy