Put the shirt in warm water with a bit of bleach, keep it there for awhile, not to long approximately 1 hour then wash it well with soap, otherwise the shirt will loose the whiteness and go greyish.
I have similar problem with white T Shirts turning yellow around collar and armpits, but the shirt also has coloured logos on it - would soaking to try and remove the yellow also remove the logos ? Am I best to treat the localised areas only ?