On occasion, God may not want us to pray for a particular person or situation. There were three different circumstances where God told Jeremiah not to pray because the people were no longer following God, but worshipping other gods.
(1) “Therefore pray not thou for this people, neither lift up cry nor prayer for them, neither make intercession to me: for I will not hear thee. Seest thou not what they do in the cities of Judah and in the streets of Jerusalem? The children gather wood, and the fathers kindle the fire, and the women knead their dough, to make cakes to the queen of heaven, and to pour out drink offerings unto other gods, that they may provoke me to anger.” (Jeremiah 7:16-18)
(2) “Then shall the cities of Judah and inhabitants of Jerusalem go, and cry unto the gods unto whom they offer incense: but they shall not save them at all in the time of their trouble. For according to the number of thy cities were thy gods, O Judah; and according to the number of the streets of Jerusalem have ye set up altars to that shameful thing, even altars to burn incense unto Baal. Therefore pray not thou for this people, neither lift up a cry or prayer for them: for I will not hear them in the time that they cry unto me for their trouble.” (Jeremiah 11:12-14)
(3) “Thus saith the LORD unto this people, Thus have they loved to wander, they have not refrained their feet, therefore the LORD doth not accept them; he will now remember their iniquity, and visit their sins. Then said the LORD unto me, Pray not for this people for their good. When they fast, I will not hear their cry; and when they offer burnt offering and an oblation, I will not accept them: but I will consume them by the sword, and by the famine, and by the pestilence.” (Jeremiah 14:10-12)
Jesus revealed a similar thought when he sent his disciples out to share the gospel with the people. He instructed them, by means of an idiom, that if they were rejected they should “shake the dust off their feet” and move on.
“And he called unto him the twelve, and began to send them forth by two and two; and gave them power over unclean spirits; And commanded them that they should take nothing for their journey, save a staff only; no scrip, no bread, no money in their purse: But be shod with sandals; and not put on two coats. And he said unto them, In what place soever ye enter into an house, there abide till ye depart from that place. And whosoever shall not receive you, nor hear you, when ye depart thence, shake off the dust under your feet for a testimony against them. Verily I say unto you, It shall be more tolerable for Sodom and Gomorrha in the Day of Judgment, than for that city. And they went out, and preached that men should repent.” (Mark 6:7-12) An account of this can also be found in Matthew 10:14 and Luke 9:5.
Another thought that we may want to consider is the fact that there may be times, even though we mean well, when we may go too far and cause damage to our credibility or to the kingdom of God. Some people may not like to hear that we are praying for them, even if we are. Jesus says, “Give not that which is holy unto the dogs, neither cast ye your pearls before swine, lest they trample them under their feet, and turn again and rend you.” (Matthew 7:6)