St. Thomas Aquinas
Although not mentioning St. Anselm by name, St. Thomas Aquinas formulates and refutes St. Anselm's "a priori argument"* in Summa Theologica I q. 2 a. 1 "Whether the existence of God is self-evident?" arg./ad 2†:
Objection 2: Further, those things are said to be self-evident which are known as soon as the terms are known, which the Philosopher (1 Poster. iii) says is true of the first principles of demonstration. Thus, when the nature of a whole and of a part is known, it is at once recognized that every whole is greater than its part. But as soon as the signification of the word "God" is understood, it is at once seen that God exists. For by this word ["God"] is signified that thing than which nothing greater can be conceived. But that which exists actually and mentally is greater than that which exists only mentally. Therefore, since as soon as the word "God" is understood it exists mentally, it also follows that it exists actually. Therefore the proposition "God exists" is self-evident.
[…]
Reply to Objection 2: Perhaps not everyone who hears this word "God" understands it to signify something than which nothing greater can be thought, seeing that some have believed God to be a body. Yet, granted that everyone understands that by this word "God" is signified something than which nothing greater can be thought, nevertheless, it does not therefore follow that he understands that what the word signifies exists actually, but only that it exists mentally. Nor can it be argued that it actually exists, unless it be admitted that there actually exists something than which nothing greater can be thought; and this precisely is not admitted by those who hold that God does not exist.
*Prologion, quoted in Deely 2001 pp. 234-6
†cf. Contra Gentiles lib. 1 cap. 10 & 11
First Vatican Council
It was not the mind of the First Vatican Council fathers to condemn "a priori" or "ontological" arguments of God's existence.
The First Vatican Council fathers considered formulating Dei Filius ch. 2 as follows:
God […] can be known certainly and demonstrated by the natural light of human reason, that is, by metaphysical, cosmological, and moral arguments.
—transl. in: Lawrence Dewan, O.P., “The Existence of God: Can It Be Demonstrated?,” Nova et Vetera 10, no. 3 (Summer 2012): 731–56, p. 734.
Explicitly mentioning "metaphysical, cosmological, and moral arguments" seemed unnecessary. Msgr. Gasser (bishop of Brixen, Tyrol, Italy) argued that knowledge by means of created things does not exclude "the celebrated ontological argument of St. Anselm":
What is suggested by this emendation can hardly be approved, the reason being a false supposition of this emendation. The reverend emendator in expressing it is of the opinion that our teaching is opposed to the best known arguments, or at least opposed to the metaphysical argument. But this supposition is altogether false: our teaching is in favour of these arguments and not against these arguments. For, if we say that God can be known by the natural light through creatures, that is, through the vestiges which are impressed on all creatures, much less do we exclude the image which is impressed on the immortal soul of man: hence, the metaphysical ["a priori" or "ontological"] argument is certainly not excluded. Who amongst us, when he shall have confirmed by his vote this doctrine which has been proposed by us, who indeed will think that he has condemned the celebrated ontological argument of St. Anselm, whatever he may think of that argument?
—transl. in: Dewan 2012 p. 734
The final version of Dei Filius ch. 2 has simply:
God […] may be certainly known by the natural light of human reason, by means of created things