A snug wire-mesh fence with straight runs, firm posts, and a gap-free bottom edge keeps pets and many common garden pests out.
A garden fence is less about looks and more about control. When it’s built to match your yard, you stop losing seedlings, stop chasing pets, and stop doing “repair harvests” after a night of nibbling. You also get a clear border that makes watering, mulching, and trellising easier.
This article walks through the choices and the build, in the order that keeps mistakes low: decide the target pests, plan the layout, set posts, tension the mesh, then hang a gate that shuts cleanly.
Decide what the fence must block
Different animals test fences in different ways. Dogs lean and push. Rabbits squeeze and dig. Deer jump. Before you buy mesh, walk the garden edge and note what you see: tracks, droppings, chewed stems, and spots where an animal could slip under.
Match the design to the problem
- Height: limits what can hop over the top.
- Mesh opening: decides what can squeeze through.
- Bottom edge: stops digging and nose-under pushes.
- Gate fit: decides whether the fence is a barrier or a shortcut.
Plan the layout and check rules
Keep fence runs straight when you can. Straight lines tension better and use fewer posts. Pick a gate spot that matches your real traffic, like the path you already use with a wheelbarrow.
If you’re building near a sidewalk, a corner lot, or a property line, rules can apply. A clear example of what cities spell out is the City of Portland’s page on fence permits and height measurement. Your local code may differ, so treat it as a checklist for what to verify where you live.
Square the corners so the fence pulls tight
For a rectangular bed area, use the 3-4-5 method. From a corner stake, measure 3 feet down one side and 4 feet down the other. Adjust until the diagonal between those marks is 5 feet. Square corners make gates hang better and keep mesh seams neat.
Choose materials that fit your soil and budget
Most garden fences are posts plus wire mesh. Corners and gate posts carry the load, so spend your money there. Line posts can be lighter if the run is short and the mesh is stiff.
Posts
Pressure-treated wood posts are easy to cut and screw into. Metal T-posts go in fast and work well with welded wire. In soggy soil, posts rot or loosen faster, so set them deeper and brace corners.
Mesh
Hardware cloth blocks small pests near ground level, but it costs more. Welded wire is the common middle ground for mixed pests. Deer mesh is tall and light, so it needs strong corners and closer spacing in windy yards.
Building a fence around a garden for deer and rabbits
If deer and rabbits both visit, build for the small animal at the bottom and the tall animal at the top. That means small openings near the ground plus enough height to discourage deer where you live. The University of Georgia Extension notes that deer can clear surprising heights and suggests planning in the 6–8 foot range when deer pressure is real, plus anchoring the bottom edge to stop slipping under. Their overview on garden fencing is a solid reference when you’re weighing fence height.
Rabbits are more about gaps than height. The University of Idaho Extension shares practical fence height targets and mesh guidance on its page about wildlife in the garden. The takeaway is simple: small openings, tight to the ground, and adjust for snow depth if winters pile up.
Set posts that won’t wobble
Posts are the bones. If posts lean, mesh loosens and gates drag. Set corner posts first, then gate posts, then line posts.
Depth that holds in real yards
A steady rule is to bury about one-third of the above-ground post height. For a 6-foot fence, that’s close to 2 feet in the ground. In loose soil, go deeper. In rocky soil, use more posts and add bracing at corners.
Brace corners and gate posts
Corners take pull from two directions. Gate posts take pull plus the gate’s weight. Use thicker posts here. Add a diagonal brace or a horizontal brace with tension wire so the corner doesn’t creep over the season.
Use a cut list before you buy
Measure the perimeter and pick a post spacing that matches your mesh. Then count posts and rolls on paper. It’s the easiest way to avoid a mid-build supply run.
| Goal | Fence setup | Notes |
|---|---|---|
| Keep dogs out | 4 ft welded wire on wood or T-posts | Prioritize a latch that can’t pop open |
| Stop rabbits | 2–3 ft wire with ≤1 inch openings near ground | Pin or trench the bottom edge |
| Block deer | 6–8 ft deer mesh on braced corners | Height plus a clean top line |
| Deter chickens | 4 ft welded wire plus a kick board | Kick board reduces scratching under |
| Limit groundhogs | 3–4 ft welded wire with a 12–18 in apron | Apron works well in rocky soil |
| Protect raised beds | Low panels or hoops per bed | Good when only a few beds need it |
| Mixed pests on a budget | 4 ft welded wire + small-mesh strip at base | Add 24 in hardware cloth along the bottom |
| Windy sites | Top tension wire + closer post spacing | Wind load can bow posts and loosen fasteners |
How To Build A Fence Around My Garden Step By Step
Work in this order so the fence stays straight and tight.
Step 1: Set corner and gate posts
Dig holes, set posts plumb, and tamp soil in layers. Concrete can help in loose, wet soil. Let posts firm up before you pull mesh.
Step 2: Run a string line and set line posts
Pull a string between corners at the planned fence face. Set line posts on that line so the fence doesn’t wander. For many welded-wire builds, 6–8 foot spacing works. For tall deer mesh or windy yards, tighten spacing.
Step 3: Add a top rail or tension wire
A top rail keeps runs straight. If you skip the rail, run a tension wire and tighten it with a simple strainer so you can re-tighten after posts settle.
Step 4: Hang and tension the mesh
Start at a corner. Fasten the mesh at several points, then pull it tight toward the next post. Work along the run, keeping the mesh plumb. On wood posts, drive staples snug without crushing the wire. On T-posts, use the right clips.
Step 5: Seal the bottom edge
Pick one method and do it well:
- Pin to ground: ground staples each 12–18 inches, mesh flush with soil.
- Trench and backfill: sink 4–8 inches, then pack soil tight.
- Apron: bend 12–18 inches outward, then top with soil or mulch so diggers hit wire early.
Step 6: Hang the gate and tune the latch
Hang the gate after the mesh is tight so posts are under real load. Use two hinges rated for outdoor use. Add a diagonal brace on the gate frame that runs from the bottom hinge side up to the latch side to resist sag. Install a gate stop so the latch meets the same spot each time.
Estimate materials with clean math
Use your perimeter and spacing to estimate counts. Add a small buffer for overlaps and odd corners.
| Item | Typical spec | How to estimate |
|---|---|---|
| Line posts | Wood 4×4 or metal T-post | Perimeter ÷ spacing, then round up |
| Corner posts | Thicker than line posts | One per corner, plus one per major direction change |
| Gate posts | Stout posts with bracing | Two per gate opening |
| Wire mesh | Welded wire or deer mesh | Perimeter minus gate width, add 5–10% for overlaps |
| Base strip (optional) | 24 in hardware cloth | Length of runs where small pests dig or squeeze |
| Staples or clips | Galvanized | 8–12 per post for mesh, more at corners |
| Tension wire (optional) | 12–14 gauge | Length of runs where sag is likely |
| Gate hardware | Hinges, latch, stop | One set per gate, plus spare screws |
Pick heights and openings that match what you see
If you’re unsure what to build, start with what shows up in your beds. A low fence with wide openings may stop a dog, but it won’t slow a rabbit. A tall fence with big openings can still let rabbits slip through at ground level.
As a starting point, many gardeners use welded wire around 4 feet tall for general pet control, then add a small-mesh strip at the base where nibbling starts. When deer browse is routine, taller mesh and braced corners often cost less than replanting all season. When rabbits are the main issue, the tight bottom edge and small openings do most of the work.
Fix the issues that let pests slip in
Most fence failures come from three places: a leaning post, sagging mesh, or a gap at ground level.
Leaning posts
If a post starts to lean, correct it early. Pack soil tight around the base, add a brace, and re-tighten the top wire if you use one. Gate posts deserve extra attention since the gate adds constant torque.
Sagging mesh
If mesh sags, add a top tension wire and tie the mesh to it. Check fasteners on hot days and after storms, since wood can swell and shrink.
Ground gaps
Walk the fence line after heavy rain and after mowing. Fix small gaps with staples, a short apron patch, or packed soil. Small repairs beat replanting a whole bed.
Keep it working with light upkeep
Once a week, do a two-minute walk-around. Check the latch, tap any loose staples, and clear vines that pull on mesh. A fence that stays tight and closes cleanly is the one you stop thinking about, which is the whole point.
References & Sources
- City of Portland.“Fence permits.”Explains when a fence permit is required and how fence height is measured.
- University of Georgia Extension.“Garden Fencing.”Summarizes garden fence options and notes height and bottom-edge practices for deer pressure.
- University of Idaho Extension.“Wildlife in the garden.”Gives practical fence height and mesh guidance for excluding rabbits and other common garden visitors.
