Some people plant gopher purge (Euphorbia lathyris) as a means of deterring gophers. The plant is poisonous, and there is no evidence that it is effective in repelling or controlling gophers. Further, it may become a problem weed, and it can be toxic to children or pets.
Trapping is very effective in controlling pocket gophers on small areas. To be effective research has shown that because of the pocket gopher's reproductive capacity, you need to remove more than 70% of the gophers. Trapping is most effective in the spring or fall when gophers are pushing up new mounds. If you catch nothing in a trap in two days, move it to a new spot. In spring or early summer, when gophers are mating or when young may be present, it is a good idea to reset traps in the same spot after the first gopher is caught. Common Gopher Traps, illustration from: Prevention & Control of Wildlife Damage, 1994.
You will need to find the main tunnel to place your traps. You will want to set the traps in both directions in the main tunnel, or set one in each lateral tunnel. You may have to experiment with different traps and where to place them. Some trappers have had more success when they leave tunnels open; others, after placing the trap, close off the tunnel with a board or sod. Traps need to be attached to a stake with wire. To maximize your efficiency, 10 to 15 traps per acre are generally needed. Gopher trap placement illustration from: Prevention & Control of Wildlife Damage, 1994.