The first mention to the title of Messiah (or Christ) in the Gospel of John is from Andrew testifying to Peter right after he met Jesus.
John 1:41 He first found his own brother Simon, and said to him, “We have found the Messiah” (which is translated, the Christ).
But on Matthew it's recognized by Peter, and Jesus even prohibits the dissemination of his revelation.
Matthew 16:15-16 He said to them, “But who do you say that I am?”. Simon Peter answered and said, “You are the Christ, the Son of the living God.” Jesus answered and said to him, “Blessed are you, Simon Bar-Jonah, for flesh and blood has not revealed this to you, but My Father who is in heaven.
Matthew 16:20 Then He commanded His disciples that they should tell no one that He was Jesus the Christ.
What is the explanation for this apparent discrepancy?