Shah Nazar and Danish have been charged with making statements that promote enmity between groups and for publishing obscene material in electronic form, Sub-Inspector at Jansath police station Vikram Bhati said.
The duo, residents of communally-sensitive Kawal village, had allegedly circulated a photograph of Adityanath on WhatsApp and wrote objectionable comments against a religion.
They were produced before Chief Judicial Magistrate Jitender Singh, who sent them to judicial custody until December 4.