Sarah, Duchess of York has compared the way women are pitted against each other online to the rivalry attributed to her and Diana, Princess of Wales.

She did not mention the Duchesses of Cambridge and Sussex by name but her comments will also be seen as a reference to Kate and Meghan’s reported rift, that has seen their online fans at loggerheads.

The Duke of York’s ex-wife described much of social media as a “sewer” as she called for people to be kinder online.

Writing an open letter in support of Hello! magazine’s #HelloToKindness campaign, promoting kindness on social media, Sarah spoke out against the treatment of women.

She wrote: “Women, in particular, are constantly pitted against and compared with each other in a way that reminds me of how people tried to portray Diana and me all the time as rivals, which is something neither of us ever really felt.”

Kensington Palace staff are spending hours each week moderating online abuse aimed at Kate and Meghan, with some of the worst hate-filled personal messages said to be between rival fans of the duchesses.

The royal women have been the subject of a series of media reports claiming there is a rift between them.

There have been allegations of a dispute over who reprimands staff, tensions during Princess Charlotte’s bridesmaid dress fitting and claims that Harry and Meghan’s move from London to Frogmore Cottage in Berkshire reflects a widening gulf between the women.

Sarah and Diana were firm friends and a royal double act in the 1980s when they married into the Windsors.

But with the duchess seen at the time as an effervescent extrovert who had won over her in-laws while Diana was viewed as coolly self-contained, they were portrayed as competing against each other.

Sarah wrote: “It’s time to confront head on the fact that much of social media has become a sewer.”

She welcomed the benefits of social media, but added: “But the truth is, a lot about these sites terrifies me.

“I rarely if ever go ‘below the line’ on social media or news websites and read people’s comments.

“I know that a lot say nice things, but there’s a large minority who seem to think that all the normal rules of society don’t apply to the internet.”