Last week, Chinese state-run TV personality Yang Rui published a message through his verified account on the Twitter-like microblogging service Sina Weibo in which he appeared to throw his support behind a campaign by the Beijing Public Security Bureau to rid the city of foreigners who had either entered the city illegally or were living or working there without the proper visas.

In the message, the subject of a CRT post published Friday, Mr. Yang advised authorities on where to go to arrest "foreign thugs," suggested that...