Purpose
The use of typography to censor words was to avoid breaking obscenity laws, and it was blasphemous to make fun of religion. Religious words were censored more than "normal" swear words, and were only censored when used as part of oaths; normal use was unbleeped. Dashes were used to obfuscate from the mid-17th century and throughout the 18th century and asterisks were common from the 19th century on.
1710
Eliminative dashes, as in D--n for Damn can be found as early as 1710 in The Tatler (found via The Anatomy of Swearing (2001) by Ashley Montagu):
D---n you all, for a set of sons of whores; you will stop here to be paid by the hour! ... Why, and be d------d to you, do you not drive over that fellow?
1687
Earlier than then Rigby sodomy trial of 1698 is this citation in the OED for shit:
a1687 Duke of Buckingham Instalment in Wks. (1705) II. 88 You're such a scurvy..Knight, That when you speak a Man wou'd swear you S——te.
1688
Mark Liberman of Language Log searched LION (LIterature ONline) and found Richard Ames's "A Satyr Again Man", from Sylvia's Revenge (1688):
314 Bully how great i'th' Mouth the Accent sounds;
315 Bully who nothing breaths but Bl---d and W--nds?
1680
The same Language Log post has John Oldham's poem "Upon the Author of a Play call'd Sodom" from Works (1680):
26 Whence nauseous Rhymes, by filthy Births proceed,
27 As Maggots, in some T---rd, ingendring breed.
1684
Jack Horntip has a fascinating collection of books from the 17th century to today. Several contain typo-bleeping, but it may be that some of them are later (sometimes 19th century) reprints with censoring added at the later time, and the originals may have been uncensored.
The following are all from the Jack Horntip Collection and most only show the raw OCR (plain scanned text). It's possible they're from later printings, but from the first pages I get the impression they're the original typography. However, they could be later, edited, "facsimile" re-printings, as I'm unsure if the years would be written in Roman or Arabic numerals at this time. (These should all be available online in the Early English Books Online database for further verification.)
Edit: I've confirmed these in the EEBO database.
The earliest that has a full PDF is in Sodom or the Quintessence of Debauchery (1684) by the Earl of Rochester, which is chock full of all sorts of uncensored sexual language but bleeps out "heaven[s]", "almighty", "God[s]" (although there's a single "p—s"), for example:
Al . . . ty Cunts, whom Bolloxinion here
Say what you want, but be careful of the Church!
1675
Mock Songs and Jovial Poems (1675):
You'd find the Perfume,
Almost as strong as it was:
Nay, she had such an Art,
In Letting a F—,
I mean for the Noise and Smell;
1672
Covent Garden Drolery 2nd Ed. (date also shown on the scanned first page):
Now he that sate here had much the better pjace,
He broke not his Neck, though he wetted his Ar—
For by th'ill successive disposure of th'other
Folks saw, and they tumbled too, one o're another,
1658
Wit Restor'd by John Mennes issued in 1658:
In rythem daigne goddess to accept my verses,
I wis with worse wise men have wip't their A—
O thou which able art to take to taske all
(Pox! what will rythme to that?) oh, I'me a raskall,
1656
John Philips' Sportive Wit (1656) is chock-full of bleepos. Here's some extracts.
Here 's a Health to my Lady Kent,
that hath a bounsing C —--;
And to my Lord her husband.
that tickl'd my Lady Hunt.
-
These are they bear the sway
And keep the money;
Which he may better do,
Than his wife's ---
-
She hath a buttock plump,
Keep but thy T--- whole:
She will hold up the rump
With her black A --- hole.
-
About this T--- there stuck
Many a broken plum,
All fritter'd with a fart
Which came out of her bum,
And made it smart.
-
Take a Lady in the grasse,
Clap her ---
--- her well and let her passe;
Upon the bed then let her tumble,
Put it in,
Put it in she'l never grumble.
-
And you shall never gain a penny,
But still they will be plucking.
And think that they shall never have
Their bellies full of ---.
-
Come husband, away with this filthy curre,
It makes my flesh to rise,
He left off all, and to her did fall,
And slipt between her ---
-
On Tobacco.
WHen I do smoak my nose with a pipe of Tobacco after a feast,
Then down let I my hose, and with paper do wipe mine — like a beast.
It so doth please my minde,
It doth so case behinde,
For to wipe,
For to wipe my tewel.
Tobacco's my delight,
So 't is mine to sh —
Oh fine smack,
Oh brave cack my jewel.
Searching Early English Books Online, I've found an earlier typo-bleepo.
1651
James Smith's The Loves of Hero and Leander a mock poem : with marginall notes, and other choice pieces of drollery (page 14, EEBO):
He tooke him to a trusty rock,
And stript him to the ebon nock.
And being naked look't like Mars,
With purple scab upon his A---