London (CNN) Britain's royal family is beefing up its social media operation amid a rise in racist online abuse targeting the Duchess of Sussex in the months after the announcement of her pregnancy, sources have told CNN.

Kensington Palace staff are devoting more resources to deleting comments targeting Meghan, and blocking abusive Twitter and Instagram accounts. Software is being used to filter out the use of the n-word as well as emojis of guns and knives.

As part of the effort, the royal family issued a set of guidelines last week for people engaging with its social media channels.

Separately, the advocacy group Hope Not Hate analyzed a sample of more than 5,000 tweets containing the most commonly used anti-Meghan hashtags. The analysis of the tweets, posted between January and the middle of February, shows that a tight-knit group of accounts is behind much of the trolling.

Twenty accounts were responsible for about 70% of the tweets, sharing anti-Meghan hashtags, pictures and memes. The fact that such a small number of users generated such a large number of the tweets suggests that the accounts were created for the purpose of producing negative content about the duchess, Hope Not Hate said.

The Twitter bios associated with the users typically contained Meghan-related hashtags like #Megxit and #Charlatanduchess, as well as political hashtags like #Brexit and #MAGA (Make America Great Again), sometimes in combination.

Some of the accounts also shared links to far-right websites and social media pundits. Many posts used racial epithets to describe Meghan. However, there is no evidence that the accounts analyzed by Hope Not Hate are part of a far-right campaign against the Duchess.

CNN contacted Twitter and Instagram for comment. Twitter has since suspended a few of the accounts analyzed.

The small group of accounts that troll the duchess often retweet news articles that portray Meghan negatively.

Photos: Royal romance: Harry and Meghan Britain's Prince Harry and Meghan, Duchess of Sussex, attend the annual Commonwealth Day service at London's Westminster Abbey on March 9. This marked the couple's final engagement as senior members of the royal family. Hide Caption 1 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry attend the Endeavour Fund Awards in London on March 5. Hide Caption 2 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry visit the Canada House in London on January 7. The couple announced the next day that they would be stepping back from their roles as senior members of the British royal family. Hide Caption 3 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry visit a community center in Windsor, England, in November 2019. Hide Caption 4 of 32 Photos: Royal romance: Harry and Meghan The couple attends the annual Festival of Remembrance in November 2019. Hide Caption 5 of 32 Photos: Royal romance: Harry and Meghan Harry and Meghan attend a pre-ceremony reception for the WellChild Awards in October 2019. Hide Caption 6 of 32 Photos: Royal romance: Harry and Meghan Meghan is photographed during a royal tour of South Africa in October 2019. Hide Caption 7 of 32 Photos: Royal romance: Harry and Meghan Archbishop Desmond Tutu kisses Archie, Meghan and Harry's son, in September 2019. Hide Caption 8 of 32 Photos: Royal romance: Harry and Meghan Harry and Meghan dance during their royal tour of South Africa in September 2019. Hide Caption 9 of 32 Photos: Royal romance: Harry and Meghan Meghan holds Archie during the South African tour. Hide Caption 10 of 32 Photos: Royal romance: Harry and Meghan Harry and Meghan greet singer Beyoncé and her husband, rapper Jay-Z, as they attend the European premiere of the film "The Lion King" in July 2019. Hide Caption 11 of 32 Photos: Royal romance: Harry and Meghan New York Yankees manager Aaron Boone presents the couple with a jersey for Archie before a Major League Baseball game in London in June 2019. Hide Caption 12 of 32 Photos: Royal romance: Harry and Meghan Queen Elizabeth II looks at her new great-grandchild, Archie, in May 2019. Prince Philip is on the far left. Meghan's mother, Doria Ragland, is next to her at right. Hide Caption 13 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry present their newborn son at Windsor Castle in May 2019. Hide Caption 14 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry walk past tapestries during a visit to Rabat, Morocco, in February 2019. Hide Caption 15 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry attend a Christmas Day church service in December 2018. With them, from left, are Prince Charles; Prince William; and William's wife Catherine, the Duchess of Cambridge. Harry and William are the two sons of Prince Charles and the late Princess Diana. Hide Caption 16 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry cheer on sailors during the Invictus Games in Australia in October 2018. Hide Caption 17 of 32 Photos: Royal romance: Harry and Meghan The couple talks to members of OneWave, an awareness group for mental health and well-being, in Sydney in October 2018. Hide Caption 18 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry pose with the cast and crew of the musical "Hamilton" after a performance in London in August 2018. Harry gave those in the theater something to remember after breaking into mock-song at the end of the show. The show was held to raise money for his HIV charity, Sentebale. Hide Caption 19 of 32 Photos: Royal romance: Harry and Meghan Members of the royal family watch a flyover during a July 2018 event marking the centenary of the Royal Air Force. From left are Prince Charles; Prince Andrew; Camilla, the Duchess of Cornwall; Queen Elizabeth II; Meghan, the Duchess of Sussex; Prince Harry; Prince William; and Catherine, the Duchess of Cambridge. Hide Caption 20 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry attend the Royal Ascot horse races in June 2018. Hide Caption 21 of 32 Photos: Royal romance: Harry and Meghan The couple poses with family members after getting married in May 2018. Hide Caption 22 of 32 Photos: Royal romance: Harry and Meghan Just after getting married, the newlyweds wave during their carriage procession in Windsor, England. Zoom in for a closer look Hide Caption 23 of 32 Photos: Royal romance: Harry and Meghan The couple watches Coach Core apprentices take part in a training exercise in Birmingham, England, in March 2018. The Coach Core apprenticeship scheme was designed by the Royal Foundation to train young people to become sports coaches and mentors within their communities. Hide Caption 24 of 32 Photos: Royal romance: Harry and Meghan Harry and Meghan join Prince William and Catherine, the Duchess of Cambridge, during a Royal Foundation Forum in February 2018. Hide Caption 25 of 32 Photos: Royal romance: Harry and Meghan The couple watches a dance class during a visit to Cardiff, Wales, in January 2018. Hide Caption 26 of 32 Photos: Royal romance: Harry and Meghan The couple meets well-wishers during an appearance in London in January 2018. Hide Caption 27 of 32 Photos: Royal romance: Harry and Meghan A shop worker in Windsor, England, adjusts memorabilia celebrating the engagement of Harry and Meghan. Their engagement was announced in November 2017. Hide Caption 28 of 32 Photos: Royal romance: Harry and Meghan Meghan flashed her engagement ring to reporters during a November 2017 photo call. The ring, designed by Harry, featured a large diamond from Botswana and two smaller outer diamonds from the personal collection of Harry's late mother. Hide Caption 29 of 32 Photos: Royal romance: Harry and Meghan This engagement photo was released by Kensington Palace. Hide Caption 30 of 32 Photos: Royal romance: Harry and Meghan Meghan and Harry made their first public appearance as a couple at the Invictus Games in Toronto in September 2017. The pair were introduced in July 2016 by mutual friends in London. Hide Caption 31 of 32 Photos: Royal romance: Harry and Meghan Harry and Meghan embrace at a polo match in May 2017. Hide Caption 32 of 32

There was a brief lull in the negative coverage after Prince Harry instructed his spokesperson to issue a statement in November 2016 before the couple married, calling out "the racial undertones of comment pieces and the outright sexism and racism of social media trolls and web article comments."

Yomi Adegoke, author of Slay in Your Lane: The Black Girl Bible, said Meghan was very much a departure from what most people associate with the British royal family.

"She's foreign, not just by being American, but she's got black heritage, she's a divorcee," Adegoke said.

"She's just a very different type of person and somebody that I don't think your average British member of the public thinks of when they think of the word duchess or royal family at all."

The royal family on the balcony of Buckingham Palace in July 2018.

Much of the trolling exploits the claims of a rift between Meghan and her sister-in-law, the Duchess of Cambridge. Where Kate is lauded by the media for exposing her shoulder in a dress, Meghan is accused by the tabloids of breaking royal protocol for doing similar.

When Meghan wears dark nail polish, the "vulgar fashion move" is criticized for breaking royal protocol "again." Meanwhile, Kate is said to opt for "subtle" shades more in keeping with the Queen's preferences.

There is no protocol on nail varnish in the British monarchy.

Type "Meghan" and "Kate" in to Google News and you get reams of eye-popping stories comparing the sisters-in-law based on what the palace says is a manufactured feud.

William, Kate, Meghan and Harry attend at the Church of St Mary Magdalene on the Sandringham estate on December 25, 2018.

"It's just clickbait," a source close to both duchesses told CNN.

The pressure to produce ever more dramatic headlines to drive traffic is intense, perhaps even more so when it comes to Meghan than when Kate Middleton entered the royal family. Back then, the running theme was how Kate came from working-class roots

So, is there any truth to the rift? The duchesses were in their 30s when they met, and already had their own established, close-knit groups of friends. And while the pair may not hang out together or call each other regularly, the source tells CNN, they are friendly and they text one another -- linked as they are by a common bond.

Kate and Meghan at Wimbledon on July 14, 2018.

The alleged rift has also been cited as the reasons Meghan and Harry are moving out of Kensington Palace and plan to establish their own office. But CNN's source said this is more to do with Harry wanting greater independence, and William needing his own team in preparation for so-called "reign change," when Charles will become King and William will step up as the Prince of Wales.

At a royal foundation event in February 2018, Harry and William suggested that if there were any disagreements, they were between the brothers, and not the wives.

The royal press pack has pushed back against accusations that they are biased against Meghan. They say they are just doing their job, covering the news without prejudice, and they claim they do far more positive stories about Meghan than negative ones. But online trolls have exploited the "othering" of Meghan on online news sites and gossip pages and reports of a feud between her and Kate.

Harry, Meghan Kate and William attend the first annual Royal Foundation Forum in London in February 2018.

Hope Not Hate researcher Patrik Hermansson said he was surprised to see discussions about Meghan, which he described as "pure conspiracy theories," suggesting she isn't really pregnant but is wearing a fake baby bump.

"The way I understand that ... it's an attempt to distrust and make her seem unreliable and distrustful," he said.

Meghan and Harry's forthcoming child will be the first known mixed-race baby in the royal family's thousand-year history. Adegoke, the author, said speculation is rife about his or her likely appearance.

"There's been a lot of talk on Twitter, not just from racists but also people who are very pro-Meghan, about recessive genes, about whether the baby will have an afro, whether the baby will have its mother's nose," she said.

"There's all these coded conversations happening about what the baby will look like, and it sounds really horrible to think, but a lot of people offered up the idea that the blacker the baby looks, the worse its treatment will be."

Harry and Meghan attend a reception for the Prince of Wales at Buckingham Palace on March 5, 2019.

Hermansson said the anti-Meghan trolls have also seized on themes like so-called "cultural decline."

"Meghan Markle fits into this bigger idea of the West and the UK in decline," he said. "She does that by not fitting in, by being who she is, which is mixed race. People tie these things so much to what they think it means to be British, which is white. So, it has a racial element to it."

"But there's also this idea of cultural decline -- [that] what we were before, a strong palace, a monarchy, an empire ... is falling apart, and that of course is brought on by these other far-right conspiratorial ideas, like what mass immigration is doing with our society, the replacement of British people of British culture."

Harry and Meghan walk through the walled public Andalusian Gardens during a visit to Rabat, Morocco in February 2019.

That narrative has already been used to troubling effect; in December last year, a UK offshoot of a violent US neo-Nazi group posted an image calling for Prince Harry to be shot, according to a BBC investigation. And they accused him of being a "race traitor" for marrying a mixed-race woman.

"Those ideas can enable people and... motivate people to take direct action in a violent way. There are lots of examples of that in just the last [few] years," said Hermansson.

Harry and Meghan's 2018 wedding was hailed as a moment that united British society, and cemented the country's connection with the US; the announcement that a new royal baby was on the way should have bound them still closer.

But the marriage and the impending arrival of baby Sussex have also exposed divisions which a very small group of people are keen to exploit to spread their message of hate.