The present study tested whether the coupling of covert attentional shifts and motor planning of pointing movements can be modulated by learning. Participants performed two tasks. As a primary movement task, they executed a pointing movement to a movement target (MT) location. As a secondary visual attention task, they identified a discrimination target (DT) that was presented shortly before initiation of the pointing movement. These DTs either occurred at the same or at different locations with the MT. A common finding in such and similar settings is the enhanced visual target identification when locations of MT and DT coincide. However, it is not known which factors govern the flexibility of spatial attention–action coupling. Here, we tested the influence of previously learned spatial contingencies between MT and DT on the coupling of covert attention and motor planning. These contingencies were manipulated in three groups (always same locations, always opposite locations, non-contingent locations) in a training session. Results indicated that in a subsequent test phase, previously learned contingencies enhanced visual identification accordingly, even when targets for the movement task and the visual task were presented at opposite sides. These results corroborate previous findings of a rather flexible interaction of attention and motor planning, and demonstrate how one can learn to control attention by means of motor planning.