Limit Transformation for Vertices

Hello I am new to blender.

I am trying to use the shrinkwrap modifier to wrap a subdivided cylinder to an uneven shaped object. The thing is, the shrinkwrap modifier also displace the Z-axis of the vertices.
I tried to apply object constraint to the cylinder, limiting Z-axis transformation. However it limit only the Z-axis transformation of the whole object, not vertex wise.

How can I limit the Z-Axis (Or any other axis) transformation of Vertices? Thanks.