Even though the sources of the ultra high energy cosmic rays (UHECRs) are yet to be known clearly, the high-quality data collected by the most recent CRs observatories signal that the sources of these CRs should be of the extragalactic origin. As the intergalactic mediums are thought to be filled with the turbulent magnetic fields (TMFs), these intergalactic magnetic fields may have a significant impact on how UHECRs travel across the Universe, which is currently expanding with acceleration. Thus the inclusion of these points in the theory is crucial for understanding the experimental findings on UHECRs. Accordingly, in this work we study the effect of diffusion of UHE particles in presence of TMFs in the light of f (R) theory of gravity. The f (R) theory of gravity is a successful modified theory of gravity in explaining the various aspects of the observable Universe including its current state of expansion. For this work we consider two most studied f (R) gravity models, viz., the power-law model and the Starobinsky model. With these two models we study the diffusive character of propagation of UHECR protons in terms of their density enhancement. The Greisen-Zatsepin-Kuzmin (GZK) cutoff, the dip and the bump are all spectrum characteristics that UHE extragalactic protons acquire when they propagate through the cosmic microwave background (CMB) radiation in presence of TMFs. We analyse all these characteristics through the diffusive flux as well as its modification factor. Model dependence of the modification factor is minimal compared to the diffusive flux. We compare the UHECR protons spectra that are calculated for the considered f (R) gravity models with the available data of the AKENO-AGASA, HiRes, AUGER and YAKUTSK experiments of UHECRs. We see that both the models of f (R) gravity provide the energy spectra of UHECRs with all experimentally observed features, which lay well within the range of combine data of all experiments throughout the energy range of concern, in contrast to the case of the ΛCDM model.