Allegations of infidelity by Debra Shanley will not be admissible in the trial of her husband, who is accused of killing her, a judge in Hackensack decided Wednesday.

The ruling came just before attorneys for Peter Shanley of Dumont called Steven Braverman as their first witness in Shanley’s murder trial in state Superior Court in Hackensack, claiming that Braverman had an affair with Debra Shanley.

Defense attorneys argue that Braverman, of Glen Rock, met Debra Shanley after she started riding motorcycles as a hobby and joined a Harley Davidson owners’ group in early 2010.

Brian Neary, one of the defense attorneys, had said during his opening statement that one of Debra Shanley’s friends in the biker group became more than just a friend and started a sexual relationship with Debra Shanley. He said Peter Shanley was deeply frustrated for months when his wife of 35 years began spending more time away from home, and finally snapped on April 10, 2010, severely beating his wife with a club and stabbing her to death during an argument at their home.

Shanley is charged with murder and faces up to life in prison if convicted. If jurors, however, find that the killing was fueled by passion provocation, he could be convicted of manslaughter and face a maximum of 10 years in prison.

Neary argued during a hearing outside the presence of the jury on Wednesday that he should be allowed to question Braverman about his relationship with Debra Shanley — an incident that he said contributed to Peter Shanley’s unusual state of mind at the time of the killing.

Carol Novey-Catuogno, an assistant Bergen County prosecutor, opposed Neary’s request, arguing that bring up Debra Shanley’s relationship with Braverman was merely an attempt to “dirty up” Debra Shanley so that jurors would sympathize with her accused killer.

Judge Edward Jerejian agreed with Catuogno and ruled that the relationship was irrelevant to the issue at trial.

Braverman later testified that he went for a ride with Debra Shanley and two other friends the night she was killed. He also testified that about 10 days before her death, he went to Debra Shanley’s home for the first time after she called him and told him that her husband destroyed her motorcycle.

Earlier testimony showed that Peter Shanley, angered by his wife’s new hobby, damaged her motorcycle. Shanley later told police that he only cut the bike’s handlebars, and that someone else — probably one of his wife’s biker friends – did additional damage to the bike and blamed it on him so that it could be rated as totaled and Debra could get a new bike.

On Wednesday, Braverman denied repeatedly that he or any of his friends did any additional damage to the bike.

“None of us damaged the bike,” Braverman said. “She [Debra Shanley] told me Peter did all the damage.”

Earlier on Wednesday, a Bergen County medical examiner testified that Debra Shanley bled to death after a stab wound to her neck cut her main arteries and veins in half and slashed her trachea.

Shanley is charged with murder and faces up to life in prison if convicted. If jurors, however, find that the killing was fueled by passion provocation, he could be convicted of manslaughter and face a maximum of 10 years in prison.