The Whitham equation was proposed as a model for surface water waves that combines the quadratic flux nonlinearity ffalse(ufalse)=12u2 of the Korteweg–de Vries equation and the full linear dispersion relation Ωfalse(kfalse)=ktanhk of unidirectional gravity water waves in suitably scaled variables. This paper proposes and analyzes a generalization of Whitham's model to unidirectional nonlinear wave equations consisting of a general nonlinear flux function f(u) and a general linear dispersion relation Ω(k). Assuming the existence of periodic traveling wave solutions to this generalized Whitham equation, their slow modulations are studied in the context of Whitham modulation theory. A multiple scales calculation yields the modulation equations, a system of three conservation laws that describe the slow evolution of the periodic traveling wave's wavenumber, amplitude, and mean. In the weakly nonlinear limit, explicit, simple criteria in terms of general f(u) and Ω(k) establishing the strict hyperbolicity and genuine nonlinearity of the modulation equations are determined. This result is interpreted as a generalized Lighthill–Whitham criterion for modulational instability.