There is often confusion about were (a past subjunctive) and was (a past indicative) after wish. In conditional sentences where the condition is unreal or not yet real and in that clauses after to wish, use were: I wish it were true that he loved me. Were is also used following “as if” and “as though”: The toddler wore the towel proudly, as though it were a Superman cape. Were can also be part of fixed expressions: as it were, if I were you.
These sentences are in the subjunctive mood, used mainly to express a speaker’s attitude about the likelihood or reality of a situation. If the sentence was in the indicative mood, then a sentence would read like this: I wish she was coming to the party. Was has many other uses, e.g., The viewing audience wanted to know if the actress was pregnant. So, the traditional rule requires one to use were rather than was in a contrary-to-fact statement that follows the verb wish. Though many still use this “rule”, the indicative was in such clauses can be found almost as often.