I recently bought a house and am in the process of replacing all the ungrounded outlets with GFCI outlets. I was able to install one correctly in a bedroom, but there are two others that I wasn't able to install. There is some sort of metal bar that is preventing the GFCI outlet from going all the way in. It's the rusty, round bar at the bottom of the receptacle in the below picture. What is that bar and what should/can I do about it?
Those are the nails that fasten the box to the framing. I'd slide them free with a locking pliers, remove the box, and install modern "remodeler" boxes with flyout mounting tabs. If you trim your plaster/drywall very carefully you'll never know it was done.
You may also be able to find more compact GFCI outlets that are designed for such boxes.
Honestly the pictured bar just looks like NM cable clamp, and there are two in the box. Those clamps are needed. What you have here is a more common problem:
A shallow box.
Or to be more precise, not a deep box. A great many boxes are too shallow for GFCI. I tried fitting an older GFCI into a common 2x2x4 1-gang metal box, and it wouldn't fit. They make shallow 2x4 boxes, and shallow 4x4 boxes that would have the same problem.
The answer to a shallow box is a box extension. These come in a variety of sizes and heights to suit many boxes. For instance I stacked a 2x2x4 box extension on top of the box intended for the GFCI, and voila. They make telescoping box extensions specifically for drywall work. They also make extensions designed to stick out somewhat out of drywall, such as those intended for transitions to surface conduit.
Or put the GFCI somewhere else.
You may be able to dodge the entire issue by putting the GFCI in an upstream location, such as a receptacle closer to the service panel, or in the service panel itself as a GFCI breaker.
You should know that you do not need a GFCI at each receptacle location, this is a terrible idea which invites dangerous miswiring, and will at best be very annoying when it trips. Each circuit should have only one GFCI at the first location where that is possible. See here here here.
This can include GFCI breakers inside the panel when the price is feasible. You can even get GFCI/AFCI combo breakers which protect both from electrocutions and wiring arc-ignited fires.