We show that every Fricke invariant meromorphic modular form for $Gamma_0(N)$ whose divisor on $X_0(N)$ is defined over $mathbb{Q}$ and supported on Heegner divisors and the cusps is a generalized Borcherds product associated to a harmonic Maass form of weight $1/2$. Further, we derive a criterion for the finiteness of the multiplier systems of generalized Borcherds products in terms of the vanishing of the central derivatives of $L$-function of certain weight $2$ newforms. We also prove similar results for twisted Borcherds products.