- 1 Basic rules
- 2 Multiple client flavors
- 3 File load order
- 4 Interface version
- 5 AddOns list formatting
- 6 Loading conditions
- 7 Saved variables
- 8 Informational
- 9 Restricted
- 10 Details
- 11 Patch changes
- 12 See also
- 13 References
.toc (Table of Contents) files contain information about a particular addon (such as its name, description, saved variables, etc), as well as instructions on how the addon should be loaded by the client (for example, the order in which lua and xml files should be loaded). The file must be present, and have the same name (plus extension) as its parent folder for the addon to be recognized by the client.
The .toc file and addon folder name need to match, e.g.
The file may contain the following elements:
- Metadata as
## Directive: Value
- Comments as
# this is a comment
- A list of files as
# will be interpreted as the start of a filename. However, the client trims whitespace around metadata values (after the colon).
\) are recommended for subdirectories to prevent issues with <Include> tags.
## Interface: 90200 ## Title: Waiting for Godot ## Notes: Nothing to be done. ## Version: 1.0 # This line is a comment Vladimir.xml Estragon.lua libs\SomeLibrary.lua
Multiple client flavors
Classic and retail versions of the game can be properly supported by including multiple TOC files in the same addon. The client first searches for the respective suffix and otherwise falls back to
|Burning Crusade Classic|
- Clients also recognize legacy suffixes
- It's recommended to simply use
AddonName.tocfor retail since CurseForge otherwise will not accept the zip.
File load order
The .toc file provides an ordered list of files to be loaded by the client. In the earlier example:
- Vladimir.xml loads first, and is in the same folder as the .toc file
- Estragon.lua loads second, and is in the same folder as the .toc file
- SomeLibrary.lua loads third, and is in a subfolder called libs
Not every file must appear in a .toc list:
- XML files may contain <Script file="nameOfAnotherFile.lua" /> or <Include file="alsoLoadThis.xml" />
- Texture:SetTexture() and PlaySoundFile() can use images and sounds contained within the addon folder and its subfolders
## Interface: 90200
The interface metadata specifies which version of the game client the addon has been made for. This field prevents users from experiencing errors by loading out-of-date addons or mixing Retail and Classic; unless they explicity ignore warnings and choose "Load out of date addons". Omitting this field causes the game to treat the addon as always out of date.
There are a number of ways to get the current interface version:
- It probably is 90200 (retail), 20504 (bc classic) or 11403 (classic)
- But these numbers are maintained locally, so they might be out of date.
- Use GetBuildInfo
- In particular,
/dump select(4, GetBuildInfo())should output the correct version to your chat frame.
- Steal it from another AddOn
- Recently updated AddOns, which are not listed as "out of date" by the client contain the latest Interface version in their toc.
Prior to patch 8.2.0:
- Extract FrameXML and check FrameXML.toc
- Launch wow with the
-consoleflag, then at the login screen, activate the console using the `/~ key, and type
ExportInterfaceFiles codeto extract FrameXML files into World of Warcraft\BlizzardInterfaceCode.
- View FrameXML.toc online
- For instance at wowcompares.
AddOns list formatting
The following directives change how an AddOn appears in the AddOns list. Both may be coloured using UI escape sequences (e.g.
|c########|r), or localized by appending a hyphen and the locale code (e.g.
Title-enGB). Later entries overwrite earlier ones, so the non-localized fallback should go first.
## Title: Waiting for Godot ## Title-frFR: En attendant Godot
## Notes: This word is |cFFFF0000red|r
The following directives control when an AddOn loads, and any dependencies that must or may load first.
1to delay loading until LoadAddOn().
## LoadOnDemand: 1
RequiredDepsand any word beginning with
## Dependencies: someAddOn, someOtherAddOn
## OptionalDeps: someAddOn, someOtherAddOn
## LoadWith: someAddOn, someOtherAddOn
## LoadManagers: someAddOn, someOtherAddOn
disabledto require the user to explicitly enable the AddOn in the AddOns list.
## DefaultState: disabled
- Main article: Saving variables between game sessions
## SavedVariables: foo, bar
## SavedVariablesPerCharacter: anotherVariable
The following metadata may be accessed using GetAddOnMetadata().
- The AddOn author's name, displayed
- The AddOn version. Some automatic updating tools may prefer that this string begins with a numeric version number.
- Any custom metadata prefixed by "X-", such as "X-Date", "X-Website" or "X-Feedback"
The following tag is inaccessible to third-party AddOns.
1with Blizzard's digital signature to indicate a secure AddOn.
- WoW reads up to the first 1024 characters of each line only. Additional characters are ignored and do not cause an error.
- Starting from Patch 9.0, 1.14.0 and 2.5.3, newly created/added files and even complete addons, are also detected when doing a
/reloadafter the game started.
- Patch 9.1.0 (2021-06-29): Multiple TOC files now possible using a suffix to disambiguate Classic, BCC and Retail.
- Patch 9.0.1 (2020-10-13): /reload recognizes changes to TOC metadata and entirely new files.
- Patch 4.0.1 (2010-10-12): /reload recognizes changes to the file order.
- Patch 2.1.0 (2007-05-22): Added LoadManagers metadata
- Patch 1.11.0 (2006-06-19): Added Secure metadata
- Patch 1.9.0 (2006-01-03): Added LoadWith metadata
- GetAddOnInfo returns basic information about an addon.
- GetAddOnMetadata returns information listed in a specified .toc tag.
- GetBuildInfo returns the client's interface version
- Using the AddOn namespace