I read somewhere that a modern Exocet missile would not be able to penetrate the armour of a WWII era battleship. If that's the case, then why did shipbuilders stop using armour?
Ships still have armor, but it traditional armor is heavy and expensive which means you have serious tradeoffs of cost and performance, so you only design a ship to accomplish it's mission and defeat relevant threats. The WW2 battleships like the Yamamoto had massive 18" guns firing a shell weighed up to 3000 lbs which is an enormous amount of energy, more than most modern missiles pack. But they could only fire 25 miles or so. With modern tactics and technology a battleship will not sneak within 50 miles of your ship to put a supersonic, car sized shell through your hull. So there is simply no need to build your ship to withstand a force like that unless you want a heavier, more costly, and slower ship. Modern ships are being built to counter supersonic missiles with radar controlled guns like the phalanx system, electronic jamming signals, chaff to spoof missiles into blowing up in a cloud of foil that looks like a target on radar, and the last line of defense is the armor. Sure there's plenty of good old fashioned metal to protect the ship but modern vessels have reactive armor. This is essentially metal, explosives and sensors that explode outward when it detects a blast inwards, helping to counter some of that force and limit the damage.