James Griffiths is a Senior Producer for CNN International and author of " The Great Firewall of China: How to Build and Control an Alternative Version of the Internet ."

Hong Kong (CNN Business) Weibo can't seem to get it right.

After apparently censoring a popular hashtag related to LGBT issues, the Chinese social networkrestored access Tuesday following a major backlash from users.

That backlash saw Weibo filled with rainbow flags, while related hashtags attracted millions of views and posts.

In many ways, it was a repeat of what happened last year, when Weibo launched a campaign to "clean up" the platform , including the removal of all gay-themed cartoons and videos — along with pornographic and violent material — to comply with Chinese laws and regulations.

The Twitter-like service, which boasts nearly 400 million active users, had to backtrack then too after an uproar from activists and ordinary users.

Both incidents show just how difficult it can be for even some of China's largest internet companies to toe the government's ever-moving line on what is permitted on the internet.

A spokesman for Weibo did not respond to CNN's request for comment for this article.

After Weibo banned the "super topic"( similar with tag) of "les(bian)"with 480 million hits and WeChat forbiddened using rainbow emoji in usernames, online protest is raising again this weekend. pic.twitter.com/KyIthaCqQI — 吕频Lü Pin (@pinerpiner) April 15, 2019

Great Firewall

While there are some hard and fast rules for what content is banned in China — pornography, separatism, terrorism, for example — for the most part companies are expected to regulate themselves. There is no comprehensive blacklist of sensitive topics, so companies, and their legions of censors, must second-guess whether individual posts or discussions are to be allowed, based on their interpretation of public pronouncements and campaigns.

"Due to the lack of transparency in censorship decisions by the Chinese government and Chinese social media companies, we won't be able to really know who was behind the censorship and then the reversal," Yaqiu Wang, a researcher at Human Rights Watch and expert on Chinese media, told CNN.

She said that a vague clause in the recently passed Cybersecurity Law , on respecting "social morality," may "have driven Weibo to censor LGBT content."

Woes of China censorship reporting: multiple mechanisms, lots of layers, lots of actors, opaque motives and topics move in and out of censors' attention... I'm still seeing lots of concern out there about renewed efforts targeting LGBT content. — Christian 马思潭 (@cdcshepherd) April 16, 2019

The general lack of certainty about what they're supposed to police often leads companies to err on the side of caution, fearing potentially ruinous punishments for failing to censor something they should have.

Last year, Quora-style question and answer service Zhiyu was removed from app stores for a week "due to lax supervision and the spread of illegal information," according to a leaked censorship directive . Other companies have faced major fines and suspensions in the past.

But taking the initiative on censorship can also get companies in trouble, as Weibo has learned twice now. While the Chinese government has stepped up restrictions on the country's LGBT community in recent months, there has been no official directive — yet — that anything to do with gay or lesbian issues should be censored.

This appears to have left Weibo stuck between its young, more liberal users, and the old, conservative men who run the Communist Party, unsure of who to please and running the risk of angering both.

Crackdown?

Weibo's brief censorship of LGBT content is not the first sign that official attitudes may be hardening.

Homosexuality is not illegal in China and the authorities removed it from the official list of mental disorders in 2001. But in recent years, the Communist government under President Xi Jinping has taken an increasingly hardline stance on LGBT rights, banning portrayal of same-sex relationships on television and online.

In March, most mentions of homosexuality were removed from "Bohemian Rhapsody," the award-winning biopic of British rock band Queen's frontman Freddie Mercury, prior to its release in China. Among the clips that were removed were scenes of men kissing and the word "gay" for the Chinese audience.

According to the South China Morning Post , several LGBT organizations, including the Guangzhou Gender and Sexuality Education Centre, have been shut down in recent months.

Speaking to the Financial Times before the Weibo ban was rolled back, a spokesman for the Beijing LGBT Centre predicted that "China's censorship of LGBT content will be ever more strict this year compared to last year."

Wang, the HRW researcher, saw two reasons for the government's apparent hostility to LGBT issues.

"The Communist Party wants to assert itself as the only moral authority in Chinese society and dictate ... what is not for the public to consume, often in the name of national security and social stability," she said.

The Chinese government considers independent civil society groups and organized protests as threats to its rule, Wang added.

"It certainly does not want to see China's LGBT community becoming more empowered through online organizing."