Guardrails, though commonly made out of metal tubing, can be constructed out of almost any rigid material. The simplest material to build with is wood, which is easily available and simple to assemble. A simple barrier can be built using 1 x 4 planks, which will fit easily over the side of the bed frame when you need it and removed when you don't. A strong hard wood like cherry will be stronger and will last longer than a less expensive wood like pine, but either wood will work in the short term.
Measure the width of the bed frame that you will be attaching the guardrail to. Measure the length of the bed to determine the length of your guardrail. Also measure the depth from the top of the bed frame side to the top of the slats supporting the mattress to determine the length the guardrail legs need to overlap the bed frame.
Cut wood for the guardrail that is the same width and length as the bed frame and measures 4 inches across. Cut two lengths if you need a guardrail on each side. For example, if your bed frame measures 3/4 of an inch in width, then your guardrail plank will also need to measure 3/4 of an inch wide. Luckily, that is the actual width of a 1 x 4 plank.
Cut wood for two legs on each guardrail. You will need a spacer for each leg that is the same width as your bed frame so that the guardrail fits tightly on the side of the bed and doesn't move. The spacer should be shorter than the framing leg pieces by 4 inches plus the inside bed frame measurement, and must leave room to hold the bed frame in each leg.
Sand down any imperfections in the wood that might catch and splinter. When using a soft wood like pine, coat the wood surface with paint, stain or varnish to prevent the wood from later splintering. Don't worry about splinters when using a hard wood. Still, staining or oiling hard wood protects it and gives it a nice clean surface.
Let the coated wood dry for at least 24 hours, depending on instructions of the coating material being used. The surface should be smooth and not tacky to the touch before you start screwing the different parts together.
Center each spacer piece 4 inches below the top of the framing pieces so that the guardrail can fit in smoothly. Clamp and screw the legs together, with one screw coming in on each face. There should be several inches to hold the bed frame between the bottom of the spacer and the bottom of the outer leg pieces.
Place the guardrail square in the legs, and attach each leg to the rail with 3 screws in a triangular pattern.
Attach the guardrail to the bed and move it back and forth to make sure it won't fall off easily.
Keep in mind when measuring your bed-frame that lumber measurements are slightly larger than the actual measurement of a piece of wood. For example, if you are buying a 1 x 4 plank, the actual measurement of the wood will be closer to 3/4 x 3 1/2 inches.
Double check that all the corners between legs and guardrails are square before you screw anything together, if the guardrail is not perfectly square it will not hold up well when its rolled into. Make the guardrails 1 1/2 - 2 feet shorter than the length of the bed if you want to be able to climb into and out of bed without removing the railing entirely.
The guardrail legs should be long enough to ensure that at least 5 inches of guardrail sticks up above the mattress to catch whoever is rolling into it. If you are using this for a child's bed, the gap between the bottom of the railing and the top of the mattress should be no more than 3 1/2 inches so that the child can't get trapped below the rail or slip out underneath it.
Things You'll Need
Paint, stain, varnish or Tung oil