President Obama is being criticised for not joining the 40 other world leaders at the mass march in Paris in the wake of the Charlie Hebdo massacre. But, by playing down rather than playing up the terrorist killings, Obama may have shown a surer instinct about how to deal with such attacks, however horrific, than those leaders who did turn up.

It is understandable that governments and people want to show solidarity against terrorism. But in many respects, the gargantuan size and overblown rhetoric of those responding to the murders of 17 people by three terrorists, treating the episode as if it was Pearl Harbour or 9/11, plays straight into the hands of al-Qaeda and its clones.

The three terrorists, Chérif and Said Kouachi and Amedy Coulibaly, were rather pathetic figures before 7 January, but have now achieved demonic status. Their actions on that day have sent millions of people into the streets, brought the leaders of much of the world to Paris, and led to the mobilisation of tens of thousands of soldiers and police. The three men would have been proud to have provoked such a response by committing what, by Middle East and North African standards, was a fairly run-of-the-mill terrorist attack.

This overreaction and the wall-to-wall media coverage may prove counterproductive. The reasons for this are eloquently identified by the Israeli commentator Uri Avnery, who writes: “For other potential Islamic terrorists throughout Europe and America, this [overreaction] must look like a huge achievement. It is an invitation for individuals and tiny groups to do the same again, everywhere.

“Terrorism means striking fear. The three in Paris certainly succeeded in doing that. They terrorised the French population. And if three youngsters without any qualifications can do that, imagine what 30 could do, or 300!”

The over-concentration on the Paris events diverts attention from far more violent attacks carried out elsewhere in the world by al-Qaeda-type movements. These are today able to operate freely in parts of at least seven countries in the Middle East and North Africa where there are civil wars – Afghanistan, Iraq, Syria, Yemen, Libya, Somalia and north-eastern Nigeria, almost all of which have seen terrorist incidents causing more casualties than in Paris since the start of the year.

Self-interest alone should lead the French, British and Americans to pay more attention to what is happening in these places, as they are the physical and ideological breeding grounds for al-Qaeda-type movements whose activities are increasingly affecting Western Europe.

By far the worst atrocity committed this year by an extreme Islamist movement was the slaughter of more than 2,000 people last week by Boko Haram in north-eastern Nigeria. Satellite images publicised by Amnesty International show two towns, Baga and Doron Baga, completely devastated, with 3,700 structures damaged or destroyed.

This massacre got limited coverage in the media until after the furore over events in Paris peaked, though the killers in Nigeria and France had very similar beliefs and methods of operating. But mark the difference in the international response to these two atrocities. My friend and former colleague Richard Dowden, director of the Royal African Society, has written that, if all right-thinking people are united against terrorism, “where is the ‘Je suis Nigeria’ movement?”

Certainly, there are explanations and excuses for the focus on France rather than Nigeria. The Charlie Hebdo murders took place in one of the media hubs of the world, while the far north-east corner of Nigeria on the edge of the Sahara is one of the least visited, impoverished and dangerous places on earth. The Nigerian government of President Goodluck Jonathan has shown exceptional incompetence and inertia in combating Boko Haram.

The Nigerian Army has proved incapable of stopping Boko Haram’s motorised columns of fighters that operate with the same deadly effectiveness as do their counterparts in the Islamic State of Iraq and the Levant (Isis) in Iraq and Syria. In both cases, atrocities are geared to causing terror and panic and demoralising opponents before any real battles begin.

I used in 2004 to compare Iraq to Nigeria, saying the government in Baghdad was at risk of becoming like that in Nigeria – an oil state that was not just corrupt, but an institutionalised kleptocracy in which everything was stolen and nothing was built. Then, as the Iraqi Prime Minister, Nouri al-Maliki, led the country to ruin, I thought the comparison might be unfair on Nigeria. As it turned out, I was wrong. The incapacity and wholesale theft of oil revenues by all those connected to the governments in both countries have a lot in common.

What happens in towns such as Baga and Doron Baga in Borno State, most of which has been overrun by Boko Haram, may not seem relevant to what happens next in London and Paris. But it is in such harsh, unvisited, poverty-stricken parts of the world that al-Qaeda-type movements find the most fertile soil in which to grow unnoticed until it is too late to stop them. This was true of the deserts of western Iraq, eastern Syria and southern Yemen. There they could evade or defeat government armies rotted by corruption whose brutality against local communities guaranteed sympathy and recruits for extreme jihadis.

The defence of France, Britain and other countries from terrorist attacks, like that on the Charlie Hebdo magazine, depends on finding ways of dealing with the seven or more civil wars being fought from Pakistan to Nigeria. These are the places where violent Sunni fanaticism flourishes and by which Western Europe has now been touched. Security measures and political policies need to be co-ordinated and, until they are, the march of 40 world leaders in Paris remains an empty gesture.

ORDER IT NOW

In developing effective policies to combat al-Qaeda, these same 40 leaders should think of the seven wars mentioned above as being like so many swamps where malaria-carrying mosquitoes flourish. It may be possible to prevent many of these al-Qaeda-type mosquitoes reaching Western Europe and other parts of the world. Some mosquitoes may be identified and eliminated when they get there. But whatever measures are taken, some of the mosquitoes, which today have so many suitable habitats, will get through and bite people, with fatal results.

Opposing terrorism or supporting free speech is much like being in favour of motherhood or against sin. The problem with the marches in Paris and elsewhere is that they may be a substitute for difficult policy decisions. Many of these, such as closing the Turkish-Syrian border or putting pressure on Saudi Arabia to control pro-jihadi media, would be hard to implement. But without such actions, everything else is bombast. Maybe President Obama was right to stay away.