How to Write WoW Macros
Everything you need to write World of Warcraft macros, split into bite-size sections. Learn the basics, level up with advanced patterns, steal battle-tested pro macros, then open your class's macro spellbook - General plus every spec. Pick a section to begin.
Deal damage without dropping the player you are healing
Hard-targeting a teammate should not make you choose between healing and using an offensive global. This temporary-focus pattern keeps the current enemy target when one exists. When you are targeting an ally, it remembers that ally, finds an enemy, casts your offensive spell, and immediately restores the ally as your target.
Use it for healer damage, crowd control, and interrupts. Replace Judgment with the spell you need. It overwrites a permanent focus, so use direct @arena1, @arena2, and @arena3 macros for abilities where your focus must stay intact.
#showtooltip Judgment /targetenemy [noexists][dead] /use [harm] Judgment /stopmacro [harm] /focus /targetenemy /use Judgment /target focus
Copy this exactly, then replace Judgment everywhere with your selected spell.
Holy Paladin
Judgment
Discipline Priest
Smite, Penance, Shadow Word: Death
Holy Priest
Smite, Holy Fire, Shadow Word: Death
Mistweaver Monk
Tiger Palm, Blackout Kick, Rising Sun Kick
Restoration Druid
Moonfire, Sunfire, Wrath, Cyclone
Restoration Shaman
Flame Shock, Lava Burst, Lightning Bolt, Earth Shock
Preservation Evoker
Living Flame, Disintegrate, Azure Strike
Start with the buttons that save time
- 01
Make your focus macro
Focus the enemy healer, caster, or priority target and stop retargeting just to interrupt.
- 02
Add mouseover support
Healers and dispellers can act on party frames while keeping their current enemy selected.
- 03
Move ground spells to cursor
Remove the reticle click from important placement spells, then practice the placement.
Build a safe starting macro
Choose what the button should do, enter the spell's exact in-game name, then copy it into the macro window.
Friendly mouseover
One GCD action per press#showtooltip Rejuvenation /cast [@mouseover,help,nodead][@player] Rejuvenation
Start here. These four steps take you from a blank macro to redirecting any spell with @unit - the foundation every other macro is built on.
1Anatomy of a macro
A macro is a tiny script bound to an action-bar button. Pressing the button runs each line from top to bottom in a single instant. Because of Blizzard's 'one action per keypress' rule you can only cast one spell that triggers the global cooldown (GCD) per press, but you may freely combine that cast with any number of instant, non-GCD actions such as targeting, using items, cancelling buffs, or shapeshifting.
#showtooltip- Optional first line. Makes the button borrow the icon, cooldown sweep, and range coloring of the spell it will cast. Add a name (#showtooltip Fireball) to lock the icon to one spell.
/cast (same as /use)- The workhorse command. Casts a spell or uses an item.
One GCD spell per press- You cannot chain two abilities that both trigger the global cooldown onto a single button. This is enforced by the client.
255 characters- The hard length limit for one macro. Trim spaces and drop optional words to fit.
#showtooltip /cast Fireball
The simplest possible macro: it just casts Fireball and shows its icon and cooldown.
2How conditionals work
All of a macro's power comes from conditionals written in square brackets. The game reads them left to right. Inside one bracket, comma-separated conditions are joined with AND (every one must be true). Multiple bracket groups placed before a spell act as OR: the game uses the FIRST group that passes. An empty bracket [] always passes, so it makes a perfect default fallback. Prefix any condition with 'no' to negate it.
[a,b]- a AND b - both must be true.
[a][b]- Try a; if it fails, fall through to b (OR / fallback chain).
[] or no bracket- Always true. Use it as the last group so the macro never does nothing.
[nocombat], [noharm]- The 'no' prefix negates any condition.
#showtooltip /cast [mod:shift,@focus][@mouseover,harm][] Polymorph
Reads as: if Shift is held, Polymorph your focus; else if you are hovering an enemy, sheep it; otherwise sheep your current target.
3Redirect any spell with @unit
The @unit conditional (also written target=unit) sends a spell at a chosen unit WITHOUT changing who you currently have targeted. This is the single most useful idea in macros: heal or buff an ally, or interrupt a second enemy, while never dropping your main target. Any unit token below can be combined with the conditionals in the next section.
@target- Your current target.
@focus- Your saved focus unit. Set it with /focus (or /focus [@mouseover]).
@mouseover- Whatever the cursor is over: a unit frame, a nameplate, or the 3D model in the world.
@player (or @self)- You. Great for self-casts and defensive buttons.
@cursor- The point on the ground under your mouse, for ground-targeted (green reticle) spells.
@arena1 / @arena2 / @arena3- Enemy players in arena, by frame slot - the backbone of PvP macros.
#showtooltip Rejuvenation /cast [@mouseover,help,nodead][@player] Rejuvenation
Heals the friendly unit you are hovering; if you are not hovering anyone, it heals you instead.
4Conditional reference
These are the conditions you will reach for most often. Mix and match them inside brackets with the @unit tokens above. Remember: commas are AND, separate bracket groups are OR.
Target units (@unit)
| Token | Meaning |
|---|---|
| @target | Your current target. |
| @focus | Your saved focus unit (set with /focus). |
| @mouseover | The unit frame, nameplate, or 3D model under your cursor. |
| @player / @self | You - for self-casts and defensives. |
| @cursor | The ground under your mouse, for reticle (ground-targeted) spells. |
| @pet | Your active pet. |
| @arena1 / @arena2 / @arena3 | Enemy arena players by frame slot. |
| @party1-4 / @raid1-40 | Specific group members by slot. |
| @boss1 / @boss2 / @boss3 | Active boss frames in an encounter. |
Common conditionals
| Token | Meaning |
|---|---|
| mod / mod:shift / mod:ctrl / mod:alt | A modifier key is held. Use mod:shift/alt to accept either. |
| harm | The unit is an enemy you can attack. |
| help | The unit is a friendly you can assist. |
| exists | The unit exists - guards against casting into nothing. |
| dead / nodead | The unit is dead / alive. |
| combat / nocombat | You are in / out of combat. |
| stance:N / form:N | You are in stance or shapeshift form number N. |
| spec:1 / spec:2 | Your active specialization slot. |
| known:Spell | You currently know that spell or talent. |
| channeling / channeling:Spell | You are channeling anything, or a specific spell. |
| pet / pet:Name | You have a pet out, or a specific pet by name. |
| mounted / flying / flyable | Movement state conditions. |
| group / group:party / group:raid | You are in a group of that type. |
| worn:Type / equipped:Type | An item type is equipped, e.g. worn:Shield. |
Once the basics click, these patterns - cast sequences, modifier stacking, mouseover and focus, on-use items, and cancelaura - are where macros save you real buttons and time.
5Cast sequences
/castsequence steps through a comma-separated list one press at a time, advancing only when the current spell actually fires. It is ideal for a fixed cooldown opener, not your core rotation, because a dodged or interrupted cast can leave it out of sync. It can never be looped to fire faster than the GCD. Use reset= to send it back to the first step.
reset=N- Reset to step one after N seconds without a press.
reset=target- Reset whenever you change target.
reset=combat- Reset when you leave combat.
reset=shift / ctrl / alt- Reset when you tap that modifier key.
#showtooltip /castsequence reset=10 Flame Shock, Frost Shock, Earth Shock
Each press fires the next shock; 10 seconds of inactivity resets to Flame Shock.
6Many spells on one button
Gate several abilities behind modifier keys to collapse a whole row of buttons into one slot and keep your muscle memory on a single key. Semicolons separate independent /cast clauses; the first clause whose conditions pass is the one that fires.
#showtooltip /cast [mod:shift] Greater Heal; [mod:ctrl] Renew; Flash Heal
Hold Shift for Greater Heal, hold Ctrl for Renew, press with no modifier for Flash Heal.
Heads-up: the modifier key has to be free to act as a modifier. If this macro is on keybind 1 but Shift+1, Ctrl+1, or Alt+1 are also bound to something else (action-bar paging, another ability), holding the modifier fires that binding instead of the macro. Unbind those modified combos for the macro's key in the Keybindings menu, and make sure that key isn't set as your Self Cast or Focus Cast key under Options > Gameplay > Combat.
7Mouseover and focus: the two you will use most
Mouseover casting lets healers and dispellers act on a raid-frame or nameplate without spending a global to target it. Focus casting locks a secondary enemy so your interrupt, stun, or crowd control lands on the enemy healer while you keep DPSing your kill target. Learning just these two patterns is the biggest single upgrade to how you play.
#showtooltip Wind Shear /cast [@focus,exists,nodead][] Wind Shear
Interrupts your focus if you have a living one, otherwise your current target. Set focus first with /focus or a /focus [@mouseover] macro.
8Items, trinkets, and equipment slots
/use accepts an item name, a bag position, or an equipment slot number. Slot numbers are perfect for firing an on-use trinket in the same press as a damage cooldown so your burst lines up automatically.
13 and 14- Trinket slot 1 and trinket slot 2.
10- Gloves - where engineering tinkers live.
1 / 5 / 16- Head / chest / main hand, for on-use gear or weapon enchants.
#showtooltip Recklessness /use 13 /use 14 /cast Recklessness
Pops both trinkets and your damage cooldown together on one keypress.
9Cancelaura, stopcasting, and weaving
Some of the strongest macros REMOVE an effect: dropping Ice Block a moment early, cancelling an ally's immunity so you can act, or stopping your own cast to react instantly. These commands are non-GCD and safe to stack with a cast on the same button.
/cancelaura Ice Block- Removes a buff you currently have, by exact name.
/stopcasting- Interrupts your own in-progress cast - used for fake-casting and instant swaps.
/cancelform- Drops your current shapeshift or stance.
#showtooltip Divine Shield /cancelaura Blessing of Protection /cast Divine Shield
Cancels a Blessing of Protection already on you (it blocks Divine Shield) and immediately bubbles.
10Limits, gotchas, and etiquette
A handful of hard rules keep macros legal and predictable. Macros make you faster and smoother; they never play the game for you.
One GCD spell per press- No full rotations on a single key. The client blocks casting two GCD abilities at once.
No reactive smart-casting- A macro cannot pick the best ability based on what is off cooldown or what buff is up. That would be automation and is not possible by design.
255-character cap- Keep macros lean. If one grows too long, split the icon line or shorten spell references.
Error spam- Failed conditions can trigger red error text and a sound. That is normal for [@focus] style macros when no focus exists - not a broken macro.
Battle-tested patterns pulled from real arena play - interrupts that never cost you your heal target, one-button externals, cancel tricks, and smart mount and res keys. Copy one, swap in your own spells, and bind it.
Interrupt & lockdown
Interrupt without dropping your heal target
#showtooltip Kick /cast [harm] Kick /stopmacro [harm] /focus /targetenemy /cast Kick /target focus
The healer's dream kick. If you already have an enemy targeted it interrupts them; if you are targeting an ally to heal, it quietly parks that ally as your focus, grabs the nearest enemy, interrupts, and snaps you straight back to your ally. One key that never makes you choose between healing and kicking. Swap Kick for your own interrupt.
Kick or CC a specific arena enemy
#showtooltip /cast [@arena2] Counterspell
@arena1, @arena2, and @arena3 point at the enemy in each arena frame slot, so you can lock a caster the instant they start casting without clicking their frame or leaving your current target. Make one per slot for your interrupt, stun, and CC - three-per-ability buttons like these are the backbone of high-level arena.
Healer damage
Judgment without dropping your friendly target
#showtooltip Judgment /use [harm] Judgment /stopmacro [harm] /focus /targetenemy /use Judgment /target focus
Darkriznjr's healer-damage pattern. If you already have an enemy targeted, it simply casts Judgment. If your target is friendly, it stores that friendly target as a temporary focus, targets the nearest enemy, casts Judgment, then snaps back to your original friendly target. This is for healers who hard-target teammates and still want offensive globals without losing their heal target.
Template: offensive spell while keeping an ally targeted
#showtooltip Moonfire /use [harm] Moonfire /stopmacro [harm] /focus /targetenemy /use Moonfire /target focus
Swap Moonfire for the spell you want: Flame Shock, Lava Burst, Lightning Bolt, Shadow Word: Death, Smite, Crackling Jade Lightning, or Living Flame. The focus is used as a temporary swap variable, so do not use this exact pattern on a button where you must preserve a permanent arena focus.
Targeting & uptime
Never stand idle: acquire a target and attack
#showtooltip /targetenemy [noexists][dead][help] /startattack /cast Mortal Strike
Whenever you have no target, a dead one, or a friendly selected, this grabs the nearest live enemy, turns on auto-attack, and fires your ability - otherwise it simply uses the ability on who you already have. Perfect as a spammable opener or filler that keeps your uptime tidy. Replace Mortal Strike with your main builder.
Grab the nearest ally to heal
/targetfriendplayer
Each press cycles to the closest friendly player - a fast way to lock a heal or utility target in a messy fight without hunting for a raid frame. Follow it with a heal line, or keep it as a dedicated 'target a teammate' button beside your @mouseover heals.
Party externals
One button, whatever external you have, on your partner
#showtooltip /cast [@party1,known:Ironbark] Ironbark /cast [@party1,known:Pain Suppression] Pain Suppression /cast [@party1,known:Life Cocoon] Life Cocoon /cast [@party1] Power Infusion
The game skips any line for a spell you do not know, so this one macro casts the correct external on your first partner no matter which healer you are playing that night. Copy it for @party2, and set your arena frames so party1 and party2 are the teammates you want. Add or remove known: lines to match your own kit.
Defensives & cancels
Cancel your immunity, then eat
#showtooltip /cancelaura Ice Block /cancelaura Divine Shield /cancelaura Divine Steed /cast Conjured Mana Bun
Immunities and a few movement buffs block eating, drinking, and your next cast. Stack a /cancelaura line for every buff that locks you out, then the thing you actually want on the last line. The same trick drops a bubble a split second before you act.
Strip all your protections in one press
#showtooltip Blessing of Protection /cancelaura Blessing of Protection /cancelaura Blessing of Freedom /cancelaura Divine Shield /cancelaura Blessing of Spellwarding
A dedicated 'get it off me' button. Some immunities stop you from attacking or from being helped by a teammate, so keeping every one on a single cancel key lets you react the instant you need to act. Any class can build its own version for its bubbles and movement buffs.
Line trinkets up with your burst
#showtooltip Avenging Wrath /use 13 /use 14 /cast Avenging Wrath
Slots 13 and 14 are your two trinkets; firing them in the same press as your big cooldown means your on-use burst always overlaps automatically. Add a racial with /cast Blood Fury, or an engineering glove tinker with /use 10. Drop either /use line if that trinket is a defensive you would rather hold.
Utility
Emergency stop everything
/stopattack /stopattack /stopcasting /stopcasting
An instant panic button. Doubling each line guarantees it punches through a queued cast or swing. Use it to drop auto-attack right before a Sap or CC lands on your target, or to bail out of a cast you fired by mistake.
Smart res: free out of combat, battle-res on Ctrl
#showtooltip /cast [nomod] Revive /cast [mod:ctrl] Rebirth
Out of combat it casts the slow, free resurrect; hold Ctrl to spend a real battle-res instead - so you never waste a combat-res by fat-fingering it. Healers can add [@mouseover,dead] to res whatever corpse or frame the cursor is on.
Movement
One smart mount for every zone
#showtooltip /cancelform /use [swimming] Great Sea Ray /use [flyable,known:Soar] Soar /use [flyable] Renewed Proto-Drake /use Dread Gladiator's Proto-Drake
Always mounts the right thing: it drops your shapeshift first, picks a water mount while swimming, Dragonriding or Soar wherever flying is allowed, and a ground mount everywhere else. Swap in your own mount names, and add a [mod:shift] line to force a specific favorite.
Leap in, then interrupt
#showtooltip /castsequence reset=1/tar Wild Charge, Skull Bash
Press once to close the gap, again to interrupt. The reset=1/tar condition sends the sequence back to step one after one second OR the moment you change target, so it is always ready for the next enemy. Works for any gap-closer that feeds into a melee interrupt.
Macros by class
Every class has its own spellbook: a General set shared by all specs, plus interrupt, burst, and role macros for each specialization. Pick your class.