We introduce a model for the orbital period modulation in systems with close-by giant planets based on a spin-orbit coupling that transfers angular momentum from the orbit to the rotation of the planet and viceversa. The coupling is produced by a permanent non-axisymmetric gravitational quadrupole moment assumed to be present in the solid core of the planet. We investigate two regimes of internal planetary rotation, that is, when the planet rotates rigidly and when the rotation of its deep interior is time dependent as a consequence of a vacillating or intermittent convection in its outer shell. The model is applied to a sample of very hot Jupiters predicting maximum transit-time deviations from a constant-period ephemeris of approximately 50 seconds in the case of rigid rotation. The transit time variations of WASP-12, currently the only system showing evidence of a non-constant period, cannot be explained by assuming rigid rotation, but can be modelled in the time-dependent internal rotation regime, thus providing an alternative to their interpretation in terms of a tidal decay of the planet orbit.