ON DECEMBER 10th 164 members of the United Nations adopted the Global Compact for Safe, Orderly and Regular Migration. The 34-page document is not legally binding, but it encourages governments to treat immigrants humanely, inform them of their rights and welcome them into society. President Donald Trump withdrew the United States from negotiations about the compact a year ago. Explaining this decision, his ambassador to the UN said that decisions about American immigration policy “must always be made by Americans and Americans alone”.

Until July, when the final draft of the compact was published, America remained the only one of the UN’s 193 members to have boycotted it. Since then, other governments have followed Mr Trump’s lead. Among the absentees from yesterday’s conference in Morocco were a few rich countries that are preoccupied with strong borders (such as Australia, Switzerland and Israel) and several eastern European countries whose people generally dislike foreigners (such as Hungary, the Czech Republic and Bulgaria).

Their absence is a shame. The compact is far from perfect. It is vague about how countries should cooperate on many issues, such as border management and access to public services. It offers no radical solutions for making immigration more palatable to locals (such as an additional tax on immigrant incomes, which this newspaper has advocated as part of a broader deal to allow more migration). But it lays out some sensible ground rules: ensuring that all migrants and refugees carry some sort of identification, communicating their entry requirements clearly, documenting their skills and keeping them out of detention centres if possible. Above all, the compact asserts that the best way for governments to improve control over their borders is for them to work together.

Interestingly, the American president’s scorn for migrants and globalism has not dampened the global appeal of migrating to America. Gallup, a pollster, has found that given the chance, 158m people would move permanently to the United States—and that the share of would-be migrants who pick the country as their first choice has remained roughly constant since 2010.

Moreover, Americans seem to be growing friendlier to foreigners. This year Gallup reported that a record 75% of them think that immigration is good for the country, up from 66% in 2012. On the pollster’s migration acceptance index, which measures how comfortable people are with foreign neighbours or in-laws, America ranks ninth in the world.

The current administration is unlikely to be swayed. But if the upward trend in migrant acceptance continues, then it is possible to imagine a future president signing up to the UN’s new accord.