Let f(q) denote Ramanujan's mock theta function \[f(q) = \sum_{n=0}^{\infty} a(n) q^{n} := 1+\sum_{n=1}^{\infty} \frac{q^{n^{2}}}{(1+q)^{2}(1+q^{2})^{2}\cdots(1+q^{n})^{2}}.\] It is known that there are many linear congruences for the coefficients of f(q) and other mock theta functions. We prove that if the linear congruence a(mn+t)≡0(modℓ) holds for some prime ℓ≥5, then ℓ∣m and (ℓ24t−1)=(ℓ−1). We prove analogous results for the mock theta function ω(q) and for a large class of weakly holomorphic modular forms which includes η-quotients. This extends work of Radu in which he proves a conjecture of Ahlgren and Ono for the partition function p(n).