BIRMINGHAM, Alabama - A Shelby County blogger has been freed, at least temporarily, after being held in jail five months for refusing to remove comments on his blog that a judge had ruled were defamatory against the son of former Alabama Gov. Bob Riley.

Roger Shuler, who writes the blog Legal Schnauzer, was released from the Shelby County Jail last Wednesday afternoon based on an order from Circuit Court Judge Claud D. Neilson.

In his order, Neilson stated that Shuler's wife, Carol Shuler, "has removed most of the subject matter of the injunction from the Legal Schnauzer blog, from Shuler's You Tube account, and from Shuler's Twitter account."

"The court is informed that the headlines about the subject matter of the injunction are still on the internet if you utilize Google or Yahoo. The defendant Roger Shuler, also has another blog/website that contains the material that was determined to be defamatory and made the subject of the permanent injunction," the judge wrote.

"Because of the good faith efforts made to remove the material by Carol Shuler, the court has determined that the defendant, Roger Shuler, may be released from custody pending a review by the court of all actions taken to remove the defamatory items and if the defendants have purged themselves of contempt," Neilson wrote.

But Neilson also cautioned that his final order in the case on Nov. 14, 2013 is a permanent injunction - ordering Shuler to take the comments down - and Shuler is subject to its terms in the future.

In October, Rob Riley - son of former governor Bob Riley - sued Shuler for libel after Shuler alleged on his blog that Riley had an affair. Riley sought a preliminary injunction and Neilson was specially appointed to hear it.

Neilson's order barred Shuler from posting further about Riley and ordered Shuler to remove the earlier posts about Riley from his blog.

Shuler refused to remove the comments and was arrested on charges of contempt of court and resisting arrest. He was held without bond and initially the entire case brought by Riley was hidden from public view.

A few weeks after his arrest, the American Civil Liberties Union filed a friend of the court brief arguing that a preliminary injunction against Shuler was unconstitutional and insisting that the case be opened to the public. Since then, the case has been made public.

An email to Shuler from AL.com this afternoon was not immediately returned.

But Shuler talks about his time in jail and his release on Legal Schnauzer. He states on his blog that the removal of the web items was not his "desired outcome." He wrote that he had hoped to be released because the injunction had been found unlawful and contrary to U.S. Supreme Court precedence in another case.