ANSWER: They are not to be understood as an absolute refusal to pray for the world which he came to redeem. In his last prayer, in full view of the cross upon which he would die on the morrow, he focalized his prayers upon the few who believed in him, whose faith would certainly fail unless supernaturally strengthened by divine power, when the Messiah King should yield to the powers of darkness, and die as a malefactor. Verse  must have reference to a world that was yet in alienation from him. Says Luther, "To pray for the world, and not to pray of the world, must both be right and good. Paul certainly was of the world when he persecuted and killed the Christians. Yet Stephen prayed for him. Christ also prays in like manner at the cross, Luke 23:34." His prayer for the world is that it may cease to be what it is; his prayer for believers is that they may be perfected in the love enkindled in them when they were born from above. For this chiefly his high-priestly prayer was made.
— From Steele's Answers pp. 11, 12.