In this other SE post: Is it really proper to say Ward identity is a consequence of gauge invariance? it is shown that the on-shell Ward identity is a consequence of global $U(1)$ symmetry for QED. This is very logical because the Ward identity is a consequence of the global symmetry and the contact terms are zero once you use the LSZ formula to extract the S-matrix matrix element. But it is also important to know how the the Ward identity behaves off-shell. For example when we consider the self-energy of a photon we know that
$$q_{\mu} \Pi^{\mu \nu} (q) = 0 \tag{1}$$
even if $q$ is off-shell. This is what protects the mass of the photon after renormalization.
Let us therefore write the Ward identity in the most general case:
$$\begin{equation} \label{eq1} \partial_{\mu} \langle T j^{\mu} (x) F_{1} (x_1)...F_{N} (x_n)\rangle = -i \sum_{j=1}^{n} \delta^4 (x-x_i) \langle TF_{1} (x_1)...\delta F_{j}(x_j)...F_{N} (x_n)\rangle,\tag{2} \end{equation}$$
where $F$ can be either a fermion field $\psi$ or a photon field $A^{\mu}$. Let us consider the case that for every fermion field there is an antifermion field. This is what happens in all diagrams since fermion fields inside Green's function are appear in couples inside currents. By using global $U(1)$ we get that the variations of photon fields are automatically zero, every fermion brings a $+i\theta$, and every antifermion brings a $-i\theta$, therefore the right hand side of Ward's identity is zero. This implies that even off-shell $q_{\mu} \Pi^{\mu \nu} (q)$. Therefore it is not gauge symmetry that protects the mass of the photon but global symmetry. If this is true it would imply that QED need not be a gauge theory to be renormalizable and we can add a mass term for the photon: $ \mathcal{L}_{\gamma mass}=\frac{1}{2} m_{\gamma}^2 A^{\mu}A_{\mu} $ that breaks gauge symmetry but preserves global symmetry. Also, because of the Ward identity the photon propagator after renormalization would be:
$$\begin{equation} D^{\mu \nu} = \frac{-i g^{\mu \nu}}{(q^2-m_{\gamma}^2)\left(1+ \Pi(q^2)\right)},\tag{3} \end{equation}$$
where $\Pi^{\mu \nu} (q) \equiv (g^{\mu \nu} q^2-q^{\mu} q^{\nu}) \Pi(q^2)$. This would imply that $U(1)$ symmetry preserves the mass of the photon even if $m_{\gamma} \neq 0$. All of this looks extremely suspicious to me and I am pretty sure I must have made a mistake somewhere in the derivation of the off-shell Ward identity but I can't tell where, and why assuming gauge symmetry would fix such mistake.