Not true at all. I saw Bob Dole speak at a church during the 1996 campaign. Many Republican candidates at the state & local levels appear in churches throughout Ohio (where I live) while campaigning.
That is surprising, and I would appreciate any links that you might have.
Our church lawyer and the Diocese Lawyers in 1992 sent out several letters, documents and copies of canon law stating that we could lose our non profit status for allowing any politician running for office to speak or anyone supporting a politician running for office speaking officially. Every election since then, we are reminded about the no politics re our non profit status.