Garden fences are usually place to protect areas from animal trampling and herbivory (feeding on plants). Knowing the species of herbivorous wildlife present in your area is critical to building an effective barrier. Even so, if your garden is the only patch of green for miles, then hungry animals may find a way through the sturdiest, best-designed fences.
Deer can be difficult to exclude with conventional fences and there are several “deer-proof” designs. Cottontail rabbits can be excluded with a two-foot tall poultry wire fence that is stretched tight to the ground and preferably buried at least two inches. Jackrabbit exclusion requires a three-foot tall fence buried at least six inches below ground. Javelina can be excluded using woven wire instead of (or combined with) poultry wire. Cattle and horses require a standard ranch-type fence that will withstand rubbing and pushing. Elk are perhaps the most difficult to exclude. Twelve-foot wire fences are often used, but aggressive bull elk can break through almost any wire fence. Woodrats and rock squirrels can climb and must be completely caged out where their populations are high. After reading this, you may decide to completely enclose vegetable growing areas.
Wood fences are usually more attractive than wire fences, but require some maintenance (i.e. paint, repair, etc.). Concrete block, brick, or stone are the most permanent types of fence but also the most expensive in terms of time and materials. Both wood and masonry fences can create privacy, but they also exclude light that would otherwise support plant growth. In addition, masonry fences retain and reradiate heat. This quality can be an advantage or disadvantage depending on your needs. In some situations, wood and masonry fences could trap cold air, which flows downslope on cold nights and may cause frost injury to fruit crops and tender ornamentals.
Wire fences offer many functional amenities and can be modified to make them more attractive and/or less noticeable. Chain-link fences are very common. This is because they last a long time, require little maintenance, and are very functional. Gates are welded and all parts are weather resistant. Different colored vinyl coatings are also available to help the fence blend in to its surroundings. Woven wire is also a durable fencing material and is available in a variety of heights, patterns, and hole sizes to meet your functional and aesthetic needs. Welded wire is similar to woven wire, but is usually less durable. Both woven and welded wires are best suited to level ground because they are not flexible. Chain link is slightly more flexible for use on uneven terrain. Wire fences also allow air, water, and light to pass through. Wrought iron or welded metal fences are sturdy, but usually require some knowledge, equipment, or professional assistance.
Size, location, and construction of a gate should also be considered. When large areas are fenced, you should consider putting multiple gates at allow access. The gate should be as sturdy as the fence and not restrict accessibility to equipment needed to work there. If fencing edible crops, the gate(s) should be able to exclude the herbivorous species discussed above.
Many times, a combination of fencing materials will meet multiple pest exclusion goals. My larger yard is surrounded by a five foot tall chain-link fence which excludes javelina, contains our dogs, and keeps most predators away from our chickens. The garden is also fenced within the larger yard. This allows 360 degree access for chickens around the outside of the garden which provides a measure of grasshopper control. Repost from Jeff Schalau.