THOUGH IT is easily derided as superficial, the social media campaign in support of about 300 girls who were abducted in Nigeria is producing results. The Ni­ger­ian government has been shamed into accepting intelligence and advisers from the United States, Britain and Israel, and a U.S. surveillance plane has joined the search for the girls. The fanatical leader of Boko Haram, the Islamic extremist group that carried out the kidnapping on April 15, has taken notice and shifted from a vow to sell off the girls as slaves to a proposal to trade them for prisoners. The Ni­ger­ian government appears open to negotiations.

Any rescue of the girls, who were abducted from a tiny village in northeastern Nigeria, where Boko Haram has waged a horrific war against schools and their students, would be welcome. Certainly it would vindicate the average Nigerians — most of them women — who launched the #BringBackOurGirls campaign on Twitter in outrage over the seeming indifference of the government of Goodluck Jonathan. That the campaign was joined by the likes of first lady Michelle Obama and House Speaker John Boehner (R-Ohio) brought welcome attention to the threat posed by Boko Haram, which has killed thousands of civilians over five years, has links to al-Qaeda and forms part of a mosaic of Islamist extremist groups that plague northern Africa.

The larger aim of this campaign, however, should be to alter Nigeria’s self-defeating response to Boko Haram. The government has mixed heavy-handed repression with a prickly refusal to accept advice or more than small-scale assistance from the United States and other governments. In response to vicious attacks on schools and civilians, Mr. Jonathan’s government has dispatched poorly trained and equipped military forces that have too often conducted their own rampages.

Human rights groups have documented secret detentions, extortion, burning of homes and extrajudicial killings. After Boko Haram attacked a barracks in March in an attempt to free detainees, a government counterattack killed hundreds, including many of the prisoners. If negotiations over the release of the girls move forward, the government could consider releasing some men and boys who were swept up in raids but not convicted of wrongdoing.

The Obama administration has tried pressing the government in private to adopt a broad strategy of counterterrorism, including social programs and better policing; it has tried public and private criticism of the military’s abuses. Both have been brushed off by Mr. Jonathan. U.S. legal restrictions on aid to military units involved in human rights violations are also an obstacle. Consequently, aid has been limited to training special forces and sharing intelligence.

There is probably no cause for the United States to deploy its own forces in Nigeria. But the administration should use this moment to press Mr. Jonathan to accept more training assistance for Ni­ger­ian counterterrorism forces and police as part of a broader program to build governmental institutions in the impoverished and neglected areas where Boko Haram has flourished. A good starting point would be funding and protection for schools where girls can be educated.