A spokesman for the city authorities said the decision was taken on grounds of public safety.
Shanghai has already begun a mass slaughter of poultry after the virus was discovered in pigeons at a market.
Six people have died in this latest outbreak. The H7N9 virus is a form of avian flu not before seen in humans.
It is not yet known how people are catching the disease, although the World Health Organization says there is currently no evidence of human-to-human transmission.
Four of the bird flu fatalities in China have been recorded in Shanghai.
The Chinese city is also monitoring another person who was in close contact with one of those who died after showing flu-like symptoms.
Shanghai health official, Wu Fan, was quoted by AFP news agency as saying that the person tested negative for H7N9.
“There is no possibility of spreading the infection overseas,” Wu Fan also told a press conference.
Officials ordered the slaughter of at least 20,000 birds starting late on Thursday after the virus was detected in pigeons sold in Huhuai market.
Entrances to poultry markets were sealed and police stood watch as workers disinfected the areas, reports say.
There have been 14 confirmed infections of the new bird flu virus so far in eastern China, including in Shanghai and Zhejiang province.
The latest fatality was a farmer, 64, who died in Zhejiang, state-run media say.
ZRF7BHpnLuAImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…