This is a neat little grammar question — the straightforward opposite of 'attract' is usually 'repel'. I always enjoy how a single pair of antonyms can make meanings click: 'attract' means to draw something in, to pull toward, while 'repel' or 'repulse' means to drive something away or push it back. In most contexts where you talk about magnets, people, customers, or attention, 'repel' is the go-to verb if you want the direct opposite of attracting.
That said, context matters a lot, and language loves nuance. If you say a shop 'attracts customers', the opposite might be that it 'repels customers' or that something about it 'deters customers'. If you talk about personality — someone 'attracts friends' — the reverse could be that they 'alienate' people or 'put people off'. For attention specifically, 'attract attention' might be contrasted with 'go unnoticed' or even 'distract', depending on what you mean. So while 'repel' is the clean lexical antonym, other options like 'deter', 'alienate', 'put off', or 'turn off' can be more natural depending on situation and register.
A few quick grammar and usage notes I find handy: 'attract' is a transitive verb — you attract something — and so is 'repel'. You can form passive constructions: 'She was attracted to his ideas' becomes 'She was repelled by his ideas'. For nouns, 'attraction' has a clear opposite in 'repulsion'. Note that you can’t just tack a simple prefix to 'attract' to make an opposite; forms like 'unattract' don't work. Instead, use adjectives like 'unattractive' (which describes something lacking appeal) or verbs like 'repel' to express active opposition. Also, register matters — 'repulse' is a tad more formal or forceful than 'repel', and 'deter' suggests discouragement rather than an active pushing away.
Examples that helped it click for me: 'The garden attracts butterflies' → 'The garden repels butterflies' (maybe because of pesticides). 'That marketing campaign attracted new customers' → 'That mistake repelled potential buyers' or 'deterred them'. 'The comedian's jokes attracted a crowd' → 'The bad reviews repelled the audience' or 'put people off attending'. I love these little shifts because they show how flexible English is — one clear antonym for many situations, but lots of flavorful alternatives depending on tone and nuance. Hope this makes the difference clear; I still get a kick out of spotting the perfect opposite in a sentence.