  We perform the Hamiltonian analysis of an on-shell U(1) gauge field theory,
in which the action is not invariant under local U(1) transformations but
recovers the invariance when the equations of motion are imposed. We firstly
apply Dirac's method of Hamiltonian analysis. We find one first-class
constraint and two second-class constraints in the vector sector. It implies
the photons have only two polarisations, at least at the classical level,
although the standard U(1) symmetry is explicitly broken. The reduced
Hamiltonian is bounded from below and the on-shell U(1) gauge field theory is
free from ghosts at the classical level.
