Praying under compulsion is a superficial performance of religiosity. When one turns prayer into an automated habit of detached verbiage, prayerless praying occurs.
It is no different than a conversation to oneself, or rehearsing a speech without an audience – or presenting a rehearsed speech without consideration of its impact on the audience.
I suspect that there are many roots to this practice: the appeal of religion and tradition to the flesh, a desire to appear righteous to others, or belief in a demanding yet aloof God.
I think that one remedy to prayerless praying is to restore, if one once possessed a relational view of God and man. If one reads Isaiah 1 where God calls Judah to come and reason with Him, rather than practice outward, heartless rituals, this conviction should rise. We are reminded of the obvious, yet often forgotten fact that God can see our acts of devotion for what they truly are. He knows if we are praying in faith based on who He is, or if our thanks and confessions re sincere.
Another remedy to prayerless praying, is to lose the fear of man. Often people do outwardly pious acts for the validation of others. I would say that would be strongly the case in relation to spiritual leaders and peers in Christ. The praise of man does not always equal praise from God. And good deeds done in the open, have their reward limited to the present. When one catches them self doing this, even accidentally, it might be wise to confess it to someone to avoid this pitfall. One might be surprised by how common this is!
Times where one can fall into this trap, could include the habit of working through excessively long prayer lists accompanied by a misguided fear that missing a name would leave a person/cause without aid or blessing, another time could be during a prayer meeting when a person feels the need to fill up the prescribed time allotment with speaking, rather than silently reflecting or hearing from God.
If this bothers your conscience, bring it up to God! He will help you.
The sacrifice you desire is a broken spirit. You will not reject a broken and repentant heart, O God.