A weak Galerkin discretization of the boundary value problem of a general anisotropic diffusion problem is studied for preservation of the maximum principle. It is shown that the direct application of the M-matrix theory to the stiffness matrix of the weak Galerkin discretization leads to a strong mesh condition requiring all of the mesh dihedral angles to be strictly acute (a constant-order away from 90 degrees). To avoid this difficulty, a reduced system is considered and shown to satisfy the discrete maximum principle under weaker mesh conditions. The discrete maximum principle is then established for the full weak Galerkin approximation using the relations between the degrees of freedom located on elements and edges. Sufficient mesh conditions for both piecewise constant and general anisotropic diffusion matrices are obtained. These conditions provide a guideline for practical mesh generation for preservation of the maximum principle. Numerical examples are presented.