In recent years, consistent spatial discretization schemes for meshfree particle methods to numerically simulate incompressible flow have been studied by many researchers. This study is focused on the treatment of solid wall boundary conditions for one of those schemes, namely the least squares MPS (LSMPS) scheme, and proposes a new technique to deal with no-slip and free-slip wall boundary conditions. With the proposed treatment, wall geometries are expressed by surface meshes, i.e. polygons in 3D and line segments in 2D. Thus, complicated geometries can be handled easily. Based on a Taylor series expansion, wall boundary conditions are incorporated into the differential operators acting on fluid particles located in the vicinity of a wall, through a least squares approach. As a consequence, Neumann boundary conditions can be treated quite efficiently. To verify consistency of the proposed discretization scheme, a convergence study was carried out. As numerical examples, Couette flow, plane Poiseuille flow, gravity-driven flow in a 3D square duct, a rigid rotation problem, Taylor–Green vortices and lid-driven cavity flow have been calculated using the proposed boundary treatment, with both no-slip and free-slip conditions applied. As a result, the present method agreed well with the reference solutions, which verified its computational accuracy.