Mag-Pul makes a insert for their 20rd magazines to limit them to either 5 rds or 10 rds depending upon model.
I have made magazine limiters in the past simply by inserting a wooden dowel rod of the appropriate length inside the spring.
With the magazine base removed, load how many rounds you want the magazine limited to, insert the dowel rod and mark where it sticks out of the magazine. Remove the down rod and cut just above that mark. Reassemble the magazine with the dowel rod in the center of the spring and test. You may have to adjust the length slightly to get to the point that you can insert a loaded magazine in the gun with the bolt closed and not be able to load 6 rds in the magazine.
Hope that helps,
John K