Innovative and facile methods for the preparation of metal nanoparticles (MNPs) with A highly uniform distribution and anchored on a unique substrate are receiving increasing interest for the development of efficient and low-cost catalysts in the field of alternative and sustainable energy technologies. In this study, we report a novel and facile metal-ions adsorption-pyrolysis method based on a hydrogel nanocomposite for the preparation of well-distributed nickel nanoparticles on 3D porous carbon frameworks (Ni@PCFs). The pyrolysis temperature effect on electrocatalytic activity toward methanol oxidation and catalyst stability was investigated. Physicochemical characterizations (SEM, TEM, and XRD) were used to determine the morphology and composition of the prepared electrocatalyst, which were then linked to their electrocatalytic activity. The experimental results indicate that the catalyst synthesized by pyrolysis at 800 °C (Ni@PCFs-8) exhibits the highest electrocatalytic activity for oxidation of methanol in alkaline media. Additionally, prepared Ni@PCFs-8 displays a remarkable increase in electrocatalytic activity after activation in 1 M KOH and excellent stability. The adsorption-pyrolysis pathway ensures that the Ni NPs are trapped in the PCFs, which can provide highly reactive surface sites. This work may provide a facile and effective strategy for preparing uniformly distributed metallic NPs on a 3D PCF substrate with high catalytic activity for energy applications.