Why Key clicks are the wideband sidebands created when the CW envelope switches on and off too abruptly. The occupied bandwidth of a keyed signal depends on how fast the envelope changes, so shaping the envelope with a slower, smoother rise and fall (typically on the order of 5 milliseconds) confines the sidebands close to the carrier. This is done in the keying/shaping circuit, not after the final amplifier.
Watch out Low-pass or high-pass filters at the transmitter output only remove energy far from the carrier, such as harmonics; key-click sidebands sit within a few hundred hertz to a few kilohertz of the carrier and pass right through such filters. Shortening rise and fall times makes the clicks worse.
Softer keying edges, cleaner signal: slow the rise/fall (about 5 ms) to kill clicks. Filters can't fix what's next to the carrier.