PvP flag

The PvP flag indicates whether or not you can engage or be engaged in PvP combat by a player of an opposing faction. If the player's PvP flag is enabled, they are able to be attacked and interacted with by players of the opposite faction. If the player's PvP flag is disabled, they cannot be attacked by a player of an opposing faction, and cannot attack, heal or apply buffs or debuffs to PvP-flagged targets.

The PvP flag can be seen in the top corner of the screen next to your player's portrait. You may see or  next to your portrait depending on your faction. If the icon appears, then your flag is up. If it does not, your flag is down. If your flag is temporary, the time that it will be up will be displayed. That is, as long as you are not in contested territories, not in PvP combat, and not having quests in your log that flag you for PvP. PvP flag timers of other players are not displayed.

If you use any mods that change your unit frames (your portrait, your target, and your party members), you may see that your name changes color according to your PvP flag status. Generally, other players' names will show as blue if their PvP flag is down, or green, yellow , or red if it is up; your own name will be blue if your flag is down, or green if it is up.

Putting up your flag
Your flag will be put up in any of these situations:
 * You put your PvP flag up permanently.
 * This is done by the  slash command or from player's portrait menu (right-click on portrait, select PvP | Enable). Typing   while flagged will disable PvP.
 * Many consider it an honorable act to put up your PvP flag before engaging another player, to give him or her a fair chance to react. To attack someone before you put your own flag up is known as bluewalling. While Bluewalling is not against any official rules and is used by some as part of their PvP strategy, many others consider it to be very cowardly. It does not preclude getting yourself killed, however, and there are stories on the official Blizzard forums of some getting bluewalled and coming out on top.
 * You attack an NPC marked by a PvP flag, like most quest givers, guards, and vendors. This usually applies to NPCs of the opposite faction, but also to neutral factions if you are at war with them, and in rare cases, your own faction. Certain quests require you to kill these type of NPCs. You may also be flagged without attacking aforementioned NPCs, but instead they striking you, this is considered to largely be a bug that has existed throughout the history of the game, be wary about getting attacked by guards.
 * You are in proximity to certain NPCs marked by a PvP flag. These NPCs are often found near settlements of an opposing faction, such as Goldshire and Razor Hill.
 * You accept some of the PvP quests. You will remain flagged as long as that quest is in your quest log.
 * You enter a specific territory. The scheme for flagging by zoning-in is shown in the table below:
 * The Deeprun Tram is considered a territory on PvE realms. It is possible for Horde players to enter this zone and wait out their PvP flag, although players who do so will immediately be re-flagged if they enter Stormwind City or Ironforge.
 * Certain actions that don't fit in above categories like accepting the battle standard in Zangarmarsh.

Bringing down your flag
Whatever the reason for flagging was, there is a five-minute delay to pulling down your PvP flag, after which you will return to normal PvE mode without fear of those of the opposite faction. The exception is FFA flag which is removed in just a few seconds.

Your flag timer continues to run even if you die (although getting ganked counts as PvP activity, and resets it to five minutes), so if you're tricked into turning on your PvP (or otherwise engage in PvP combat with the other faction) in friendly territory, and die, you can wait the five minutes while dead, so you can resurrect without your PvP flag up.

Other solutions include taking a ride on a flight path (on PvP servers this must be a flight to friendly territory), or entering a sanctuary. Doing so will also automatically remove the PvP flag if it is up.

Color scheme
To help a player determine the status of players quickly, Blizzard has set a color scheme to make this obvious: 1 This is possible only when you are standing outside and friendly player inside FFA zone.