Context. Massive clumps associated with infrared dark clouds (IRDCs) are promising targets for studying the earliest stages of highmass star and cluster formation. Aims. We aim to determine the degrees of CO depletion, deuterium fractionation, and ionisation in a sample of seven massive clumps associated with IRDCs. Methods. The APEX telescope was used to observe the C 17 O(2−1), H 13 CO + (3−2), DCO + (3−2), N 2 H + (3−2), and N 2 D + (3−2) transitions towards the clumps. The spectral line data were used in conjunction with the previously published and/or archival (sub)millimetre dust continuum observations of the sources. The data were used to derive the molecular column densities and fractional abundances for the analysis of deuterium fractionation and ionisation. Results. The CO molecules do not appear to be significantly depleted in the observed clumps. The DCO + /HCO + and N 2 D + /N 2 H + column density ratios are about 0.0002-0.014 and 0.002-0.028, respectively. The former ratio is found to decrease as a function of gas kinetic temperature. A simple chemical analysis suggests that the lower limit to the ionisation degree is in the range x(e) ∼ 10 −8 −10 −7 , whereas the estimated upper limits range from a few 10 −6 up to ∼10 −4 . Lower limits to x(e) imply that the cosmic-ray ionisation rate of H 2 lies between ζ H 2 ∼ 10 −17 −10 −15 s −1 . These are the first estimates of x(e) and ζ H 2 towards massive IRDCs reported so far. Some additional molecular transitions, mostly around 216 and 231 GHz, were detected towards all sources. In particular, IRDC 18102-1800 MM1 and IRDC 18151-1208 MM2 show relatively line-rich spectra. Some of these transitions might be assigned to complex organic molecules, although the line blending hampers the identification. The C 18 O(2−1) transition is frequently seen in the image band. Conclusions. The finding that CO is not depleted in the observed sources conforms to the fact that they show evidence of star formation activity, which is believed to release CO from the icy grain mantles back into the gas phase. The observed degree of deuteration is lower than in low-mass starless cores and protostellar envelopes. Decreasing deuteration with increasing temperature is likely to reflect the clump evolution. On the other hand, the association with young high-mass stars could enhance ζ H 2 and x(e) above the levels usually found in low-mass star-forming regions. On the scale probed by our observations, ambipolar diffusion cannot be a main driver of clump evolution unless it occurs on timescales 10 6 yr.