The anisotropic superfluidity in a weakly interacting two-dimensional Bose gas of photons in a dye-filled optical microcavity is investigated, taking into account the dependence of the photon effective mass on the in-plane coordinate. With the use of the generalized Gross-Pitaevskii equation and the Bogoliubov approach, it is shown that the modulation of the microcavity width leads to an effective periodic potential and the periodicity of the condensate wave function, and both the condensate energy and the spectrum of elementary excitations depend on the direction of motion. The anisotropic character of the dynamical and superfluid properties, such as helicity modulus, superfluid density, and sound velocity, as well as experimentally observable manifestations of their anisotropy are described.