We report a detailed investigation of RCoPO (R = La, Pr) and LaCoAsO materials performed by means of muon spin spectroscopy. Zero-field measurements show that the electrons localized on the Pr3+ ions do not play any role in the static magnetic properties of the compounds. Magnetism at the local level is indeed fully dominated by the weakly itinerant ferromagnetism from the Co sublattice only. The increase of the chemical pressure triggered by the different ionic radii of La3+ and Pr3+, on the other hand, plays a crucial role in enhancing the value of the magnetic critical temperature and can be mimicked by the application of external hydrostatic pressure up to 24 kbar. A sharp discontinuity in the local magnetic field at the muon site in LaCoPO at around 5 kbar suggests a sizable modification in the band structure of the material upon increasing pressure. This scenario is qualitatively supported by ab initio density-functional-theory calculations.