Officials in Karamay said the ban, which prohibits headscarves, partial face veils and burkas, would last until 20 August due to a local sports event.
Xinjiang, home to the Muslim Uighur minority, has seen an upsurge in violence in recent months.
Authorities have blamed Uighur separatists for the violence.
In a report by the Karamay Daily which was carried by national media outlets, officials listed the "five types of people" who would be banned from public transport.
They are people wearing headscarves, veils, burkas, clothes with the crescent moon and star symbol, and "youths with long beards".
"Passengers who do not co-operate, particularly the 'five types of people', will be reported to the police," said the report, which added that all commuters would be subject to bag checks.
"The security measures will ensure social stability and protect the lives, property and safety of citizens of all races," said the report.
Karamay is a city about 400km north of the region's capital Urumqi, which was hit by deadly attacks in April and May at a railway station and a market.
The latest unrest in Xinjiang took place on 28 July in Yarkant county, also known as Shache.
Chinese state-run news agency Xinhua said a group armed with knives and axes stormed a police station and government offices. It said 37 civilians and 59 attackers were killed
But an Uighur rights group has disputed that account, saying that police had opened fire on people protesting against a Ramadan crackdown on Muslims.
Reports surfaced last month that some government departments in Xinjiang were banning Muslim staff from fasting during Ramadan.
Days after the Yarkant incident the imam of China's largest mosque, in the Xinjiang city of Kashgar, was stabbed and killed.
The imam, Jume Tahir, was said to be deeply unpopular among Uighurs who disliked the fact that he praised Communist Party policies while preaching in his mosque.
Chinese Internet users had mixed reactions to the Karamay city ruling on Weibo, China's microblogging service.
"So every bearded or burka-clad person is a terrorist? For goodness sake these are traditional customs," said one.
Others however argued it was a necessary measure. "Having a beard definitely does not mean you are a terrorist. But for the sake of public safety, we should take whatever precautions we can take," said a user.