In June 1684, allegations were made against him that he had libelled the Duke of York (later James II & VII) for authorizing, as Speaker, the publication of Thomas Dangerfield's "Information" in 1680. Dangerfield, one of the most notorious of the Popish Plot informers, was by now utterly discredited (he was killed in a scuffle with a barrister the following year). To provide the protection of a seat in parliament, Williams stood and was elected for Montgomeryshire in 1685; however his return was cancelled on petition, on the grounds that the contributory boroughs had no opportunity of voting. The prosecution resumed, and he was fined £10,000. He was also fined £20,000 after similar action was instigated by the Earl of Peterborough. Supporters worked on his behalf, including the Earl of Rochester; subsequently, £8,000 was accepted as full payment for the former fine, and Peterborough accepted a token payment for the latter after persuasion from James, now king.