I have given a lot of advice here I would not give today.
The other case is just as bad. That is, to go back and change the old posts. History is doomed to repeat itself; if you don't leave the posts there, someone else will "discover" the trick and give out the "new advice." Instead, i would reply to the old post, pointing to what has been learnt. Knowing what used to be thought of as good, and what was learnt over time is best for all.
Well, except for people who look so quickly they don't read the rest of the thread. For them, an "override" post of some sort would be better. Strike-through does do that, but doesn't usually look that great and a quick reader may skip the message entirely. There are ways to finagle this idea, but posting a reply seems to be what most people do.