John Moore (1646-1714), an Anglican bishop, preached a sermon in which he discussed the "disorder of mind" of having unwanted "naughty" thoughts. His sermon was published as a pamphlet. The published pamphlet went through seven editions between 1692 and 1708, indicating that the pamphlet sold well.
I come now to the last case I proposed to speak to, which doth relate to these unhappy persons, who have naughty, and sometimes blasphemous thoughts start in their minds, while they are exercised in the worship of God, which makes them ready to charge themselves with the sin against the Holy Ghost, to pronounce their condition to be without hopes of remedy, and to fear that God hath utterly cast them off....
That their case is not so dangerous as they apprehend it, I shall endeavour to show by the following considerations.
(1.) Because these frightful thoughts do for the most part proceed from the disorder and indisposition of the body....
(2.) Because they are mostly good people, who are exercised with them. For bad men, whose heads are busied in laying one scene of wickedness or other, how they may gratify their malice, or execute their revenge, or over-reach their neighbours, or violate their trusts, or satisfy their beastly lust, rarely know any thing of these kind of thoughts, or use to complain of them. But they are honest and well-meaning Christians of unhealthy constitutions, and melancholy tempers, who are so miserably harrass'd by them; who above all things earnestly desire an interest in their God and Saviour, and for that reason the least dishonourable thought of him, which insinuates itself into their minds, is so dreadful unto them.
(3.) Because it is not in the power of those disconsolate Christians, whom these bad thoughts so vex and torment, with all their endeavours to stifle and suppress them. Nay often the more they struggle with them, the more they increase....
It will be therefore much to your detriment to hide yourselves from your friends, and to quit the calling wherein you were exercised; in that people of dejected tempers never fare worse than by themselves, and when they have nothing to do....
When you find these thoughts creeping upon you, be not mightily dejected.... Neither violently struggle with them; since experience doth teach that they increase and swell by vehement opposition; but dissipate and waste away, & come to nothing when they are neglected, and we do not much concern ourselves about them.... It is not therefore a furious combat with melancholy thoughts, which will but weaken and sink the body, and to make the case worse, but a gentle application of such comfortable things as restore the strength, and recruit the languishing spirit that must quash and disperse these disorderly tumults in the head.
*Excerpts of Moore's sermon appear in Richard Hunter & Ida Macalpine, eds., Three Hundred Years of Psychiatry, 1535-1860 (London: Oxford Univ. Press, 1963), 252-3.