Let $A$ be an algebra and let $f(x_1,...,x_d)$ be a multilinear polynomial in noncommuting indeterminates $x_i$. We consider the problem of describing linear maps $phi:Ato A$ that preserve zeros of $f$. Under certain technical restrictions we solve the problem for general polynomials $f$ in the case where $A=M_n(F)$. We also consider quite general algebras $A$, but only for specific polynomials $f$.