In a generic theory of gravity coupled to matter fields, the Smarr formula for black holes does not work properly if the contributions of the coupling constants defining the theory are not incorporated. However, these couplings, such as the cosmological constant or the dimensionful parameters that appear in the Lagrangian, are fixed parameters defining the theory, and they cannot be varied. Here, we present a robust method, applicable to any covariant Lagrangian, that upgrades the role of the couplings from being constants in the theory to being free parameters of the solutions. To this end, for each one of the couplings in a theory, a pair of auxiliary scalar and gauge fields is introduced. The couplings are shown to be conserved charges of the global part of the implemented gauge symmetry. Besides, their conjugate chemical potentials are defined as the electric potential of the corresponding gauge fields on the black hole horizon. Using this method, we systematically extend the first law and the Smarr formula by coupling conserved charges and their conjugate potentials. The thermodynamics of a black hole solution in a quadratic gravity theory is given as an example.