Abstract The unquenched quark model for the light quarkonium and the charmonium states is explored in the present work. The quark-pair creation operator in the $^3P_0$ model,
which mix the two-quark and four-quark components is modified by considering the effects of the created quark pair's energy, as well as the separation between the
created quark pair and the valence quark pair. All the wave functions needed including the mesons and the relative motion between two mesons are all obtained by
solving the corresponding Schr"{o}dinger equation with the help of the Gaussian expansion method. Our aim of the present work is to find a new set of parameters
which can give a good description of the mass spectrum of the low-lying light quarkonium and charmonium states. Moreover, some exotic states, for example $X(3872)$
can be described well in the unquenched quark model. Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. Article funded by SCOAP3 and published under licence by Chinese Physical Society and the Institute of High Energy Physics of the Chinese Academy of Science and the Institute of Modern Physics of the Chinese Academy of Sciences and IOP Publishing Ltd.