The Brans-Dicke-like field of scalar-tensor gravity can be described as an imperfect fluid in an approach in which the field equations are regarded as effective Einstein equations. After completing this approach we recover, as a special case, the known effective fluid for a scalar coupled nonminimally to the Ricci curvature and we describe the imperfect fluid equivalent of f(R) gravity. A symmetry of electrovacuum Brans-Dicke gravity is translated into a symmetry of the corresponding effective fluid. The discussion is valid for any spacetime geometry.Comment: Added some explanation in the text, typographical errors corrected. Matches version to appear in Phys. Rev.