Exactly where did it specifically say the thirty pieces of silver? Nice try, but Zecharias fits it better.
The prophecy in Matthew 27 is not referring to the thirty pieces of silver. It is referring to the "Field of Blood"(verse 8) and there is nothing in Zechariah about Judas being buried there. On the other hand, Jeremiah 19 speaks of a "Field of Slaughter" and Jeremiah is instructed to go and break a pot there to show everyone what God would do to them for rejecting him. In Acts 1:19 it is confirmed that it is the same field that Jeremiah was speaking of [Jeremiah 19:1-2].
The prophecy mentioned by Matthew was referring to Judas being appointed burial at the potter's field, the field of blood, or slaughter, in the valley of Hinnom, a place for strangers to be buried, or those that have rejected God. Him appointed such, is due to Judas having rejected God, in that he'd rejected and betrayed the ARM OF GOD, Jesus.
The Bible does not contradict itself....but sometimes takes more that superficial study to properly discern.