A judge made that a condition as he set bail at $20,000 on Friday for Robert Linhart.
The 59-year-old retired firefighter was arrested last month. Authorities say he scrawled messages of adoration for the "Crazy for You" and "Material Girl" singer outside her apartment building near Manhattan's Central Park.
Linhart's lawyer has said the messages weren't threatening - just signs of being a fan.
A grand jury declined to indict Linhart on graffiti charges. He pleaded not guilty Friday to resisting arrest and weapons possession. Authorities have said he had a knife and ice pick.