Magnesium and all of the other minerals are still available in foods nonetheless; it is a requirement for their growth. Big ag has done a number on ruining both nutritional quality and soil health in the quest for greater production and profits, this is true. So don't support it! It is not the only choice.
That said, the biggest nutritional void is not in the growing, it is in the processing and the crap people choose to eat. You can only blame the manufacturers up to a point. It is your choice on what you buy and, in doing so, support.