Guides · Macros

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.

The healer macro that changes everything

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

First setup

Start with the buttons that save time

Set up matching keybinds →
  1. 01

    Make your focus macro

    Focus the enemy healer, caster, or priority target and stop retargeting just to interrupt.

  2. 02

    Add mouseover support

    Healers and dispellers can act on party frames while keeping their current enemy selected.

  3. 03

    Move ground spells to cursor

    Remove the reticle click from important placement spells, then practice the placement.

Macro workshop

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.
Example
#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.
Example
#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.
Example
#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)

TokenMeaning
@targetYour current target.
@focusYour saved focus unit (set with /focus).
@mouseoverThe unit frame, nameplate, or 3D model under your cursor.
@player / @selfYou - for self-casts and defensives.
@cursorThe ground under your mouse, for reticle (ground-targeted) spells.
@petYour active pet.
@arena1 / @arena2 / @arena3Enemy arena players by frame slot.
@party1-4 / @raid1-40Specific group members by slot.
@boss1 / @boss2 / @boss3Active boss frames in an encounter.

Common conditionals

TokenMeaning
mod / mod:shift / mod:ctrl / mod:altA modifier key is held. Use mod:shift/alt to accept either.
harmThe unit is an enemy you can attack.
helpThe unit is a friendly you can assist.
existsThe unit exists - guards against casting into nothing.
dead / nodeadThe unit is dead / alive.
combat / nocombatYou are in / out of combat.
stance:N / form:NYou are in stance or shapeshift form number N.
spec:1 / spec:2Your active specialization slot.
known:SpellYou currently know that spell or talent.
channeling / channeling:SpellYou are channeling anything, or a specific spell.
pet / pet:NameYou have a pet out, or a specific pet by name.
mounted / flying / flyableMovement state conditions.
group / group:party / group:raidYou are in a group of that type.
worn:Type / equipped:TypeAn item type is equipped, e.g. worn:Shield.