When towel bars come loose, it's usually because they weren't well fastened in the first place. The small, wimpy wall anchors included with most towel bar sets just don't have enough holding power. But with sturdy new anchors, you can remount towel bars so they'll never come loose again. Don't put off this fix. The longer you wait, the more likely you are to scar the wall or mar the bar's finish. You can also use these techniques to remount towel rings, toilet paper holders and hooks too. Everything you need is available at home centers and hardware stores.
First, remove the loose end posts. If one post is rock solid, leave it in place (chances are it's fastened to a wall stud). You'll need a hex wrench or mini screwdriver to loosen the setscrew. There's a slight chance that the existing anchors are adequate but the screws have loosened. So try to tighten the screws that hold the mounting plates in place. If they tighten up securely, just remount the posts and the bar. If they don't tighten firmly, remove the screws and the mounting plates. To remove the old anchors, pry them out with a screwdriver or poke them in and let them fall inside the wall.
For fast, solid mounting on drywall, use toggle anchors. These clever anchors are self-drilling and have a T-clamp that folds out when you push the screw into the shaft.
Anchoring in Tile
On tile, 1/4-in. tubular plastic anchors hold firmly, whether there's drywall or cement backer board behind the tile. Be sure to buy tube-shaped anchors as shown here, not tapered anchors, which don't hold as well.
Enlarge the original anchor holes with a 1/4-in. carbide glass-and-tile bit. Tap in the plastic anchors and fasten the mounting plate with screws.