The PvP flag indicates whether or not you can engage or be engaged in PvPcombat by a player of an opposing faction. If it is up, you are open for combat against the opposite faction. If it is not, you cannot be attacked by a player of an opposing faction. The PvP flag can be seen in the top corner of the screen next to your players 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 flags 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, your name (and others' names) will show as blue if the PvP flag is down, and green if it is up.
Your flag will be put up in any of these situations:
You put your PvP flag up permanently.
This is done by the /pvpslash command or from player's portrait menu (right click on portrait, select PvP | Enable). Typing /pvp while flagged will disable PvP.
You engage another player of an opposing faction in combat other than dueling.
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 cast a spell on a player whose flag is up.
If you cast a buff (for example, Power Word: Fortitude) on your friend who has his PvP flag up, yours will also go up. If you cast a healing spell or resurrect a flagged player, your flag will go up.
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 bellow:
Zone type
Normal realm
PvP realm
Flag
Horde territory
Horde cities
Horde cities, 2 lowest level zones near them
Alliance territory
Alliance cities
Alliance cities, 2 lowest level zones near them
Contested territory
BGs
BGs, dungeons, raids, zones that don't fit into any other category
Neutral territory
Dungeons, raids, zones that don't fit into any other category
The Deeprun Tram is considered a neutral territory on PvE realms and it is possible for Horde players to enter this zone and wait out the PvP flag, although if you re-enter the capital city zone, you will immediately be re-flagged.
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: