The characteristics of spatiotemporal shaping and filtering of terahertz (THz) pulses passing through metal slits with finite thickness have been investigated by employing the finite-difference time-domain (FDTD) method. It is shown that this diffraction-based quasi-optical technique has a good influence on shaping and filtering of transverse magnetic(TM) polarized THz pulse, while has no effect on transverse electric(TE) polarized THz pulse. Furthermore, the numerical simulation results have been interpreted qualitatively by the planar waveguide theory and can be employed in the relevant experiments.