Aims. Knowledge of rotation periods (Prot) is important for understanding the magnetic activity and angular momentum evolution of late-type stars, as well as for evaluating radial velocity signals of potential exoplanets and identifying false positives. We measured photometric and spectroscopic Prot for a large sample of nearby bright M dwarfs with spectral types from M0 to M9, as part of our continual effort to fully characterize the Guaranteed Time Observation programme stars of the CARMENES survey. Methods. We analyse light curves chiefly from the SuperWASP survey and TESS data. We supplemented these with our own follow-up photometric monitoring programme from ground-based facilities, as well as spectroscopic indicator time series derived directly from the CARMENES spectra. Results. From our own analysis, we determined Prot for 129 stars. Combined with the literature, we tabulated Prot for 261 stars, or 75% of our sample. We developed a framework to evaluate the plausibility of all periods available for this sample by comparing them with activity signatures and checking for consistency between multiple measurements. We find that 166 of these stars have independent evidence that confirmed their Prot. There are inconsistencies in 27 periods, which we classify as debated. A further 68 periods are identified as provisional detections that could benefit from independent verification. We provide an empirical relation for the Prot uncertainty as a function of the Prot value, based on the dispersion of the measurements. We show that published formal errors seem to be often underestimated for periods longwards of ∼10 d. We examined rotation–activity relations with emission in X-rays, Hα, Ca II H&K, and surface magnetic field strengths for this sample of M dwarfs. We find overall agreement with previous works, as well as tentative differences in the partially versus fully convective subsamples. We show Prot as a function of stellar mass, age, and galactic kinematics. With the notable exception of three transiting planet systems and TZ Ari, all known planet hosts in this sample have Prot ≳ 15 d. Conclusions. Inherent challenges in determining accurate and precise stellar Prot means independent verification is important, especially for inactive M dwarfs. Evidence of potential mass dependence in activity–rotation relations would suggest physical changes in the magnetic dynamo that warrants further investigation using larger samples of M dwarfs on both sides of the fully convective boundary. Important limitations need to be overcome before the radial velocity technique can be routinely used to detect and study planets around young and active stars.