We study Hamiltonian form of unfree gauge symmetry where the gauge parameters have to obey differential equations. We consider the general case such that the Dirac-Bergmann algorithm does not necessarily terminate at secondary constraints, and tertiary and higher order constraints may arise. Given the involution relations for the first-class constraints of all generations, we provide explicit formulas for unfree gauge transformations in the Hamiltonian form, including the differential equations constraining gauge parameters. All the field theories with unfree gauge symmetry share the common feature: they admit sort of "global constants of motion" such that do not depend on the local degrees of freedom. The simplest example is the cosmological constant in the unimodular gravity. We consider these constants as modular parameters rather than conserved quantities. We provide a systematic way of identifying all the modular parameters. We demonstrate that the modular parameters contribute to the Hamiltonian constraints, while they are not explicitly involved in the action. The Hamiltonian analysis of the unfree gauge symmetry is precessed by a brief exposition for the Lagrangian analogue, including explicitly covariant formula for degrees of freedom number count. We also adjust the BFV-BRST Hamiltonian quantization method for the case of unfree gauge symmetry. The main distinction is in the content of the non-minimal sector and gauge fixing procedure. The general formalism is exemplified by traceless tensor fields of irreducible spin $s$ with the gauge symmetry parameters obeying transversality equations.