I have a freestanding wooden shelving unit I want to secure to the studs on the wall as they're leaning forward. However, I'd only be able to secure 1 side since the studs measure ~23" apart whereas the shelving unit is 26.5" apart. What can I do to properly secure both sides onto the studs?
Add another board across the back and screw through that into the two studs.
If you would want to locate the shelf with a stud in the middle, then use a metal angle or a wooden piece under or on top of the top shelf and fasten that to the stud. One attachment in the middle of the shelves would hold unless you are in a seismic zone and there are specific requirements.
Be sure that when you tighten the screw it does not pull the shelving unit off one or two of the feet. You might need to put shims behind the wood you are using to secure the shelf.