Efficient production of cyclic polymers has been a hot topic in the past few decades. In this work, we found that an adsorptive porous template with an appropriate size has the capability to accelerate the ring closure of a linear polymer chain in a dilute solution with a higher yield. The restricted pore provides a confined space and the effect of its characteristics, such as pore size, shape and adsorption strength on cyclization time, is systematically studied by using dissipative particle dynamics simulations. As a prerequisite of cyclization in confinement, the entry process of linear precursors has been studied as well. Total production time is governed by a tradeoff between the size effect caused by decreasing the size of the pore and the adsorption of the pore. The strong size effect suppresses polymer entry but accelerates cyclization. The stronger adsorption promotes polymer entry but decelerates cyclization. According to our defined total production time, a small spherical confinement with strong adsorption results in a shorter total production time of cyclic polymers compared to that in free solution. If chain cyclization is permitted during its entering the confinement, the interplay between steric hindrance caused by pore size and adsorption provides an additional 'virtual' confinement at the boundary between confinement and free solution. In this case, an optimal cyclization time is observed with an appropriate adsorption strength under small confinement. Our results provide useful guidance for designing suitable porous templates for producing cyclic polymers with high efficiency.