From the World Health Organization: Updated WHO recommendations for international traffic in relation to COVID-19 outbreak (29 February 2020)
WHO continues to advise against the application of travel or trade restrictions to countries experiencing COVID-19 outbreaks.
In general, evidence shows that restricting the movement of people and goods during public health emergencies is ineffective in most situations and may divert resources from other interventions. Furthermore, restrictions may interrupt needed aid and technical support, may disrupt businesses, and may have negative social and economic effects on the affected countries. However, in certain circumstances, measures that restrict the movement of people may prove temporarily useful, such as in settings with few international connections and limited response capacities.
Travel measures that significantly interfere with international traffic may only be justified at the beginning of an outbreak, as they may allow countries to gain time, even if only a few days, to rapidly implement effective preparedness measures. Such restrictions must be based on a careful risk assessment, be proportionate to the public health risk, be short in duration, and be reconsidered regularly as the situation evolves.
Travel bans to affected areas or denial of entry to passengers coming from affected areas are usually not effective in preventing the importation of cases but may have a significant economic and social impact. Since WHO declaration of a public health emergency of international concern in relation to COVID-19, and as of 27 February, 38 countries have reported to WHO additional health measures that significantly interfere with international traffic in relation to travel to and from China or other countries, ranging from denial of entry of passengers, visa restrictions or quarantine for returning travellers. Several countries that denied entry of travellers or who have suspended the flights to and from China or other affected countries, are now reporting cases of COVID-19.
Some countries have engaged in travel restrictions which don't meet the WHO's criteria above. For example, Australia does not have "few international connections", and doesn't have "limited response capabilities". In addition, Australia's travel restrictions have not been "short in duration", definitely not "a few days".
Are travel restrictions during pandemics ineffective in most situations?
In case someone wishes to say that claims by the WHO are not notable, the WHO's recommendations have been cited by government figures. From Australia should ease travel ban on foreigners from China: ambassador (February 17, 2020), China's ambassador noted that Australia's policies were inconsistent with the recommendations of the WHO. Likewise, the WHO's claims were cited by European Commission President Ursula von der Leyen on 12 March.