Usual advice says avoid long leads and avoid floating inputs. When you put a series capacitor at the end of a long wire, it creates a high-impedance antenna, permitting all kinds of EM noise and ambient mains hum to impinge on the wire, and it goes to the input.
It suggests a guideline to put the long wire on the sending device, and the series capacitor close to the input. The high-impedance condition still persists, however, and the capacitor may take some time to return to a satisfactory running state once it's exposed to unforeseeable volt levels.