Although common in spoken english, "what'd" probably shouldn't be used in writing....
Can I say or write " How'd he do that?" instead of "How did he do that?" and "Why'd, When'd" instead of "Why did and When did?"
I use those contractions, and others, in writing all the time.
So do you, don't you?