This is why farmers are encouraged to use natural, organic fertilisers. These fertilisers are made of natural products like animal manure, crop residues, vegetable waste and even sewage sludge. They still contain the sought after components of potassium, nitrate and phosphate but in organic forms like cellulose and urea. Soil organisms digest these thereby releasing the sought after inorganic ions which can be taken up by the plants.
Natural fertilisers release the inorganic ions more slowly, prevent leaching, and are a cheaper option. However, they have a lower concentration of minerals, may contain unwanted components (like fungal spores and weed seeds), and have a strong odour.