We search for an indirect signal of dark matter through very high-energy gamma rays from the Wolf-Lundmark-Melotte (WLM) dwarf irregular galaxy. The pair annihilation of dark matter particles would produce Standard Model particles in the final state such as gamma rays, which might be detected by ground-based Cherenkov telescopes. Dwarf irregular galaxies represent promising targets as they are dark matter dominated objects with well measured kinematics and small uncertainties on their dark matter distribution profiles. In 2018, the H.E.S.S. five-telescope array observed the dwarf irregular galaxy WLM for 18 hours. We present the first analysis based on data obtained from an imaging atmospheric Cherenkov telescope for this subclass of dwarf galaxy. As we do not observe any significant excess in the direction of WLM, we interpret the result in terms of constraints on the velocity-weighted cross section for dark matter pair annihilation as a function of the dark matter particle mass for various continuum channels as well as the prompt gamma-gamma emission. For the $τ^+τ^-$ channel the limits reach a $〈 σv 〉$ value of about $4\times 10^{-22}$ cm3s-1 for a dark matter particle mass of 1 TeV. For the prompt gamma-gamma channel, the upper limit reaches a $〈 σv 〉$ value of about $5 \times10^{-24}$ cm3s-1 for a mass of 370 GeV. These limits represent an improvement of up to a factor 200 with respect to previous results for the dwarf irregular galaxies for TeV dark matter search.