When it comes to pH measurement of solutions, especially diluted, standard procedure is usually enough. However, there are situations when pH measurement can't be taken out directly - like pH measurement of meat, cheese or soil. Such cases require specific sample preparation and preparation procedure can influence final result.
Let's see how the pH measurement of soil looks alike.
pH of soil can change significantly - from acidic in the coniferous forest or on peat bog, to basic on karst terrain. pH of the soil changes ability of plants to take nutrients from the ground, and some plants will not grow in acidic or basic soils perfect for other plants. Thus measurement of soil pH is very important - but in no way it is easy. Soil can be dry, and the pH electrode needs to be immersed to work. pH electrodes are very fragile so they can't be hammered into the ground. Thus measurement must be done in some other way.
Widely accepted method is to take a sample of the soil, crush any clumps, and close it in a jar filled with distilled water (about the same masses of soil and water, for example 10 g of soil and 10 mL of water, add another 10 mL of water if necessary, but not more). After some vigorous shaking sample should be left for 5 to 10 minutes to let all soluble substances to dissolve and to let all hard parts to sediment. Then pH of the solution above sediment is measured in a standard way and called "soil pH".
Procedure sounds pretty simple, and in fact it is not very difficult, however, it must be done very carefully, if the results are to be reliable and comparable. Sample must be taken with a tool that will not influence final readings. Amount of soil sampled must be always the same. Amount of added water must be always the same. Time of shaking and time the sample is left to dissolve and to sediment must be always the same.
Will it suffice? Not. A pH measured in the supernatant liquid may be considerably different than the reading obtained by placing electrode in the slurry at the bottom. For a long time it was believed that this "supension effect" is created by the large junction potential caused by the presence of charges on the soil particles. A contrary view was published more recently which argued that the charges on the soil particles either held or repelled hydrogen ions, and that the difference in readings was a true estimate of real differences in pH which existed between the suspension region and the supernatant liquid.
But even if you will insert electrode always exactly the same way into the solution, consecutive measurements accuracy will be rarely better then 0.2 pH unit, as there are still too much unknowns and changing elements in the whole process.