About Protected Items

This page is intended to inform new users of HB2.

What are Protected Items?

Each time HB2 goes to sell or repair, it will try to empty the contents of your bags by selling them to the vendor. The Protected Items mechanism tells HB2 to remove certain items from consideration for selling.

Who is responsible for protecting my items?

Ultimately, you are responsible for identifying the items you do not want to sell to a vendor. Many profile writers attempt to do this job for you; however, you should never depend on that.

How do I protect my items?

HB2 has two mechanisms for identifying the items you do not want to sell:

  • You can create a file called "ProtectedItems.xml" in your <HB2_install_dir>/ProtectedItems.xml
  • The profile writer may have included a <ProtectedItems> section in the profile you are using

Once again, never depend on the profile writer to protect your items. Consider, the <ProtectedItems> section in the profile as protecting only the items needed to complete the quests addressed by the profile. For instance, a profile running the Westfall Stew quest would protect Stringy Vulture Meat, Murloc Eye, Goretusk Snouts, and Okra. Except for when you are running this quest, you would want these items sold or deleted pronto, because they just clog you backpack.

Why do we prefer ProtectedItems.xml to <ProtectedItems> in each Profile?
Things change in the game all the time—new items and vendors added. Things are 'fixed' by Bliz. New content comes out. A profile writer isn't going to go back and check the <ProtectedItems> section of his profile every time Bliz adjusts something in a patch.

Also, a 'one size fits all' ProtectedItems.xml is not appropriate. Most toons want to get rid of Fish Oil and Shiny Fish Scales as quick as possible—a shaman would be very angry if you did this. Another example… mobs drop low-level food and drinks all the time. Low-level toons may want to hang onto them, but higher-level toons don't want their bags cluttered with such rubbish.

Isn't this ProtectedItems.xml file shared by all my toons? I don't want low-level foods when I play my high-level toons?
Yes, the single ProtectedItems.xml is shared across all your toons. And you've hit upon one of the reasons we highly recommend keeping a Parallel Directory Structure to HB2. Many people copy HB2 to different directories, then dedicate one of the copies to playing one particular toon only. If you elect to do this, your ProtectedItems.xml will only apply to the one toon you run out of the dedicated HB2 directory. The parallel directory structure we recommend makes sharing important things (like meshes and profiles) easy, while keeping things that should be separated distinct.

Isn't the file called "Protected Items.xml" (with a space)?
In the forums, you may have seen references to a file called "Protected Items.xml" (with a space), instead of "ProtectedItems.xml" (without the space). To be honest, new versions of HB2 will support either. However, the "ProtectedItems.xml" file name is preferred, and "Protected Items.xml" is considered deprecated. Hawker made it clear in this post.

What happens if I have "ProtectedItems.xml" and "Protected Items.xml" in my <HB2_Install_dir>?
That behavior is undocumented, and you cannot predict what will happen. HB2 may look for the files in a particular order, and stop with the first one it finds. HB2 may look for both files and take the union of their contents. In fact, HB2 may change how it handles this from release to release. HB2 does what it does, and how you think it should operate is not a consideration. In short, save yourself grief and confusion by deleting your "Protected Items.xml" file, or renaming it to "ProtectedItems.xml".

Doesn't the distribution of HB2 contain a ProtectedItems.xml file?
Sometimes it does, sometimes it doesn't, sometimes it is misnamed—depending on the distribution. It is our understanding that HB2 no longer comes with a ProtectedItems.xml file, such that your information will never be overwritten. But its best to have a backup, just in case. Or better yet, never install a new HB2 distribution on top of an old one.


What is the format for creating the ProtectedItems.xml file?

ProtectedItems.xml uses the XML markup language. The easiest way to edit it is using the Notepad++ editor1, since it colorizes the text and makes errors quick to see.

There are two accepted formats for placing Item entries in ProtectedItems.xml. The first is an older technique, and a comment is highly recommended, otherwise the information becomes unmaintainable:

    <Item>6948</Item>  <!-- Hearthstone -->

The first style tends to propagate a lot because it has been around longer, and people cut-and-paste from these older profiles. If you cut-and-paste the older format, just be sure to take the comments too.

The second format is newer, and is self-documenting:

    <Item name="Hearthstone" entry="6948" />

Of the two, the second format is preferred. The self-documenting feature makes the file much more maintainable. Also, it is easier to comment out whole sections in this format, if they are unneeded. Since comments cannot be nested in XML, the first format makes commenting out large sections of the file impossible.


How do I create the ProtectedItems.xml?

We suggest using a wonderful, lightweight editor called Notepad++. Unlike the Windoze Notepad, this one will colorize your XML file making it very easy to see if you make mistakes.

Cut and paste the following skeleton into the editor of your choice:

    <Item name="Hearthstone" entry="6948" >

Add any additional items you like between the <ProtectedItems> tags. When you are finished, use your editor to:

  • Use File -> Save as…
  • Name the file ProtectedItems.xml, and make sure it is saved in your <HB2_Install_Dir>.

How do I find the number that goes in the entry attribute? There are a few ways to do this:

1) Use WoWHead

  • Type your item's name into the WoWHead search box.
  • WoWHead will take you to the Item's page. For, "Hearthstone", it takes you to http://www.wowhead.com/item=6948.
  • The number following the "item=" in the WoWHead URL is the "entry" that the ProtectedItem list wants to see.

2) If you have the WoW client open, there are a number of addons that will show you ItemIDs in the tooltip:

  • Auctioneer
    Its mighty big addon to load for Item IDs, but many people already have it installed. Just go configure it to show the ItemIDs in the tooltip: Informant configuration -> General -> "Show an item's link"
  • ncItemTooltip
    Small, and lightweight.
  • there are many others, just find one you like by searching Curse and WoWInterface

3) Use Skyhigh's item lookup tool

Can you get me started with a basic ProtectedItems.xml?

Isn't there an easier way to create ProtectedItems.xml?

Yes! Protopally created the DHX Protected Items Manager. It is a plugin to HB2, so you'll need to learn how to install and use them, which is outside the scope of this article.

If you do use DHX Protected Items Manager, be aware that it blindly overwrites the ProtectedItems.xml file. It is not a 'round trip' tool—i.e., it does not read the existing file, let you make whatever changes you want, then write it back out.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License