In the context of the coronavirus disease 2019 (COVID-19) pandemic, compliance with government regulations is a tremendous challenge in the effort to curb the viral transmission. The fact that specific communities and people across the world continue to ignore government regulations of COVID-19 is a crucial issue to address. Researchers sought to examine the political psychological and sociocultural determinants of adherence to COVID-19-related law and policy measures among waste pickers in a sub-urban slum community in Iran. A cross-sectional survey of 362 waste pickers from two municipalities in the countryside of Tehran, Iran, was conducted between January and May 2022. Multiple regression analysis was used to predict the significant difference between the direct or indirect effects of political psychological and sociocultural variables on compliance with COVID-19 emergency measures. Confidence intervals were estimated using the bootstrap method. The findings supported the proposed model. The results indicated that political ideology (β = − 0.13, 95% CI − 0.29 to 0.02), individualism worldview (β = − 0.14, 95% CI − 0.32 to 0.07), fatalism (β = − 0.18, 95% CI − 0.40 to 0.04), health literacy (β = 0.16, 95%CI − 0.05 to 0.37) and prosociality (β = 0.09, 95%CI 0.03–0.13) exert an indirect effect on compliance with the COVID-19 emergency measures through both trust in government and trust in science and scientific community. This study has implications for authorities in ensuring adherence to governmental orders for COVID-19 outbreak. A democracy-based and human rights-based approach and a flexible framework for proceeding more equitable COVID-19 legal and government regulations is critical to an effective and acceptable health response to COVID-19. Instituting slum emergency planning committees, incorporating the informal providers into all pandemic response plans in every urban informal settlement and providing an immediate guarantee of payments to waste packers will be indispensable.