Two metal oxide nanoparticles, magnesium oxide nanoparticles (MgONPs) and aluminum oxide nanoparticles (Al2O3NPs), were synthesized from green sources, Salvia officials and Cuminum cyminum seed extract, respectively. These nanoparticles were used for construction of potentiometric enhancement sensors employed for the estimation of ranitidine hydrochloride (RNT) in authentic powder and commercial products. The electroactive substance ranitidine-phosphotungstate (RNT-PT) was formed by combining RNT with phosphotungstic acid (PTA) in the presence of plasticizing material o-nitrophenyloctyl ether (o-NPOE). The outcomes showed that the enhanced MgO and Al2O3 nanosensors behaved linearly across the concentration ranges 1.0 × 10−9–1.0 × 10−2 and 1.0 × 10−10–1.0 × 10−2 mol L−1, respectively. However, the conventional sensor (RNT-PT) displayed a linearity over 1.0 × 10−6–1.0 × 10−2 mol L−1. Least square equations were calculated as EmV = (54.1 ± 0.5) log (RNT) + 762.33, EmV = (58.6 ± 0.2) log (RNT) + 696.48, and EmV = (52.2 ± 0.7) log (RNT) + 756.76 for enriched nanometal oxides modified and conventional sensors, respectively. The correlation coefficients of regression equations were 0.9997, 0.9995, and 0.9992 for the above suggested sensors, respectively. The recorded results showed excellent sensitivity and selectivity of the modified nanometal oxide sensors for the quantification of the analyzed drug in its authentic samples and commercial products.