Massive stars play an important role in the Universe. Unlike low-mass stars, the formation of these objects located at great distances is still unclear. It is expected to be governed by some combination of self-gravity, turbulence, and magnetic fields. Our aim is to study the chemical and physical conditions of dense clumps at different evolutionary stages. We performed observations towards 5 regions of massive star and stellar cluster formation (L1287, S187, S231, DR 21(OH), NGC 7538) with the IRAM-30m telescope. We covered the 2 and 3–4 mm wavelength bands and analysed the lines of HCN, HNC, HCO+, HC3N, HNCO, OCS, CS, SiO, SO2, and SO. Using astrodendro algorithm on the 850 μm dust emission data from the SCUBA Legacy catalogue, we determined the masses, H2 column densities, and sizes of the clumps. Furthermore, the kinetic temperatures, molecular abundances, and dynamical state were obtained. The Red Midcourse Space Experiment Source survey (RMS) was used to determine the clump types. A total of 20 clumps were identified. Three clumps were found to be associated with the H II regions, 10 with young stellar objects (YSOs), and 7 with submillimetre emission. The clumps have typical sizes of ∼ 0.2 pc and masses from 1 to 102 𝑀⊙, kinetic temperatures of ∼ 20 − 40 K and line widths of H13CO+ (1–0) ∼ 2 km/s. We found no significant correlation in the line “width-size” and the “line width-mass” relationships. However, a strong correlation is observed in “mass-size” relationships. The virial analysis indicated that three clumps are gravitationally bound. Furthermore, we suggested that significant magnetic fields, ∼ 1 mG, provide additional support for clump stability. The molecular abundances (relation to H2) are ∼ 10−10 − 10−8.