To the best of my understanding, Ayer and Wittgenstein both thought that metaphysics was a topic which could not be spoken about.
Ayer simply shows that everything which is metaphysical is completely non-sensical and therefore cannot be spoken about. Such as private languages - which is majorly adapted from Wittgenstein. This enables Ayer to discard metaphysics as a part of philosophy as he deemed it as completely unimportant and unnecessary to philosophy.
Wittgenstein also believed that metaphysics cannot be spoken about. such as his writings about a ladder (one which i do not FULLY understand.. if anyone would care to explain i would be grateful) which to my understanding he uses the path towards metaphysics so that he can prove that it is non-sensical. Yet wittgenstein apears to be supportive of metaphysics as a part of philosophy, stating that it is of importance, just we do not know it which in itself from the text is self refuting and begs the question.
Theres clearly something i have not understood fully on the topic, if anyone can set me straight i would appreciate it as i am going to be writing an essay to do with valid propositions and therefore require the clarity on the subject!
You might want to keep two things in mind:
1. You are really talking about the earlier Wittgenstein of the and not of the much later, Philosophical Investigations
, and also of the earlier Ayer of, Language, Truth, and Logic
, and not of the later Ayer of, for instance, The Problem of Knowledge
2. Both were talking about what Kant called "speculative metaphysics" which transcended all empirical knowledge, and not what the philosopher, P.F, Strawson later called, "descriptive metaphysics" which does not. Analytic philosophers like Strawson and W.O. Quine (and others) have not refrained from discussing questions of metaphysics. See, for instance, Quine's famous essay, "On What there Is" and his book, Ontological Relativity.