Judge John Cleland's order also applies to any law enforcement investigator who has ever worked on the case and anyone acting on behalf of the lawyers.
The off-limit topics include evidence; opinions about Sandusky's guilt or innocence or about legal and factual matters under discussion; and "the reputation, character, credibility or criminal record of the defendant or any witness, prospective witness or organization which is or may testify at trial, or be the subject of trial testimony or evidence."
Cleland said he was acting to help ensure a "fair, impartial and orderly trial" for Sandusky, a proceeding scheduled to begin June 5 in Bellefonte.
Sandusky, 68, is charged with sexually abusing 10 boys over 15 years, and authorities say some of the abuse happened on Penn State's campus. Sandusky has maintained his innocence on the 52 counts against him.
The ensuing scandal led to the firing of legendary football coach Joe Paterno and the ouster of the university president.
Sandusky attorney Karl Rominger said he was studying the order.
"Having never been gagged by a court before, I will need to research the law and First Amendment issues," Rominger said in an email. "I'm pretty sure the court has the authority to limit press contacts, I just don't know what the law says about the scope and nature of such limits. Since the order does affect the media as well, I'll be curious to see if any press outlets appeal it."
A spokesman for the attorney general's office declined to comment.
Cleland said his order applies to comments that could reasonably be expected to be disseminated and to comments made on background or without attribution.
Lawyers on both sides have been speaking to banks of cameras and reporters after pretrial hearings at the Centre County Courthouse, a practice that is certain to be limited, if not ended outright, by the judge's order.
Cleland wrote that the order was "narrowly tailored to achieve its purposes in light of the unprecedented publicity generated by the case" and that he will "broadly construe this order to assure that its purposes are achieved."
He also warned lawyers to comply with professional conduct rules regarding pretrial publicity, the special responsibilities of prosecutors and the state court system's code of civility.