Humane ways of removing gophers from a yard involve live trapping and relocation or repelling them by use of aversive smells or noises. Barrier methods can keep them out of specific areas, but these are often expensive.
Gophers are social animals and often construct large communal burrows. They come into conflict with humans by being agricultural pests when their burrows create hazards for farm equipment, livestock and new construction. Their tunnels can be identified by conspicuous crescent-shaped mounds at the openings.
Gophers can be caught in live traps designed for rodents and relocated to areas where they will not be a problem. Wash the trap with dish soap before setting it out and use gloves when handling it. Place the trap just outside or inside the gopher's tunnel and disguise it with leaves. Be careful when handling a trap with a gopher in it, as gophers can bite.
Gophers can sometimes be encouraged to move elsewhere by placing fish scraps, dog or cat excrement or commercial repellents near their tunnel entrances. Noise repellents that sound like birds of prey can also work, as can devices that create loud or unfamiliar noises.
To protect small areas such as vegetable beds, consider a barrier of solid metal or close-woven mesh. The barrier must extend at least 12 inches below ground and at least 6 inches above ground.