Monitors count. These are smaller, much less armored ships, with very large guns. Used for shore bombardment. See, e.g, HMS Abercrombie. HMS Abercrombie (F109) - Wikipedia
The Lord Clive-class monitors in WW1 were particularly heavily armed, with an 18 inch gun firing a shell larger than those later used by the IJN Yamato-class battleships, at over a ton and a half shell weight. BL 18-inch Mk I naval gun - Wikipedia [EDIT, as mentioned by DrDeth, just above.]
The wiki for the Lord Clives notes (albeit with “citation needed”) that their use at the end of WW1 against a railway bridge is the longest range that a British warship has ever fired on a wartime target with a gun., at 36,000 yards. Lord Clive-class monitor - Wikipedia