For the first time, a new mode of dispersive solid‐phase extraction is presented as a simple, rapid, adsorbent‐free and environmentally friendly method for the simultaneous microextraction and preconcentration of trace amounts of two metal ions (Pb2+ and Cr3+) and two anionic azo dyes (reactive yellow 15 (RY15) and reactive black 5 (RB5)). This method is based upon the in situ formation of a layered double hydroxide (LDH) nanosorbent through an electrostatic induction process. In this method, extraction of the analytes is performed simultaneously with the formation of the nanosorbent only by adding hydroxide ions. After extraction and separation of the sorbent from the sample solution through a syringe nanofilter, the analytes are eluted by dissolving the LDHs in an acidic solution. Finally, the extracted metal cations and anionic azo dyes are directly determined by micro‐sampling flame atomic absorption spectrometry and micro‐volume UV–visible spectrophotometry, respectively. Under the optimal experimental conditions including 20 μmol of hydroxide ions, 248.4:20.8 μg l−1 of M2+:M3+ ions, 12 cycles of air agitation and 200 μl of CF3COOH (2 M), good linearities were obtained for Pb2+, Cr3+, RY15 and RB5 in the concentration ranges 50–600, 5.0–280, 30–2500 and 30–2000 ng ml−1, respectively, with correlation of determinations higher than 0.995. The preconcentration factor for the target analytes was 50 in a 10 ml sample solution. The limits of detection were found to be 15, 1.5, 10 and 10 μg l−1 for Pb2+, Cr3+, RY15 and RB5, respectively. The intra‐day and inter‐day precisions were in the ranges 4.3–6.1 and 5.5–6.8%, respectively. Additionally, the presented method is applicable for the analysis of the target analytes in different water samples with reasonable recoveries (>87%).