This paper investigates the dynamic behavior of micro/nanobeams made of two-dimensional functionally graded porous material (2DFGPM) under accelerated, decelerated, and uniform moving harmonic load, using surface elasticity and modified couple stress theories. The key feature of this formulation is that it deals with a higher order shear deformation beam theory. The non-classical equilibrium equations are developed using Lagrange's equation and the concept of physical neutral surface. The equations of motion are derived using the same approach, accounting for the porosity effect and the modified power-law distribution of material properties. The trigonometric Ritz method is used with sinusoidal trial functions for the displacement field, and the Newmark method is applied to obtain the dynamical response of 2DFGPM nanobeams. The results are compared with previous studies, and the impact of critical parameters such as gradation indices, volume fraction ratio, pattern of porosity, velocity, frequency, and motion type of the applied force are explored. This study highlights the importance of considering the porosity effect, as neglecting it can lead to significant errors in the predicted results. Additionally, the study found that the accelerated and decelerated motions of the applied load have a greater impact on the dynamical deflection of 2DFGPM nanobeams than the uniform motion. The findings of this study can provide guidance for the optimal design of micro/nanobeams subjected to a moving force with multifunctional properties.