Thermal convection in a porous square cavity undergoing harmonic oscillations along a longitudinal axis is analyzed using a finite difference technique. The cavity is heated with an end-to-end temperature difference across the walls parallel to the axis of vibration. The vibration of the cavity induces a secondary convective movement governed by a Rayleigh number based on a vibrational acceleration instead of on the gravitational acceleration as in the case of a stationary cavity in a static gravitational field. The Nusselt number across the cavity is found to oscillate, with a period of oscillation dependent on the frequency of vibration, as well as on the vibrational Rayleigh number. As the vibrational Rayleigh number and the frequency of oscillation of the cavity increase, the amplitude of the Nusselt number's oscillation increases, and its period decreases.