TESxEdit Cleaning Guide
There have been many cleaning guides written over the years, with the main one being on the Construction Set Wiki, but recent updates to TESxEdit have made most of those guides obsolete. I also thought I would collect the different aspects of cleaning mods into a single guide. What is a "Dirty" Mod?
While some would consider it's a mod that uses foul language or has scenes of a sexual nature, that's not what we mean by a "dirty" mod. Dirty mods are mods that modify records in a master file, like Oblivion.esm, that are not necessary for the mod to function. They can encompass records that have been flagged as modified, but not actually changed, and records that have actually been modified with what are called "wild" edits. The Construction Set (CS) itself is part of the problem in that records can be flagged as modified even if the mod author was just looking at a cell or viewing a dialogue record. "Wild" edits can occur when you accidentally hit a key when looking at a landscape cell, for example. Mod authors often don't even realize these changes have occurred, so as a mod author, it is important that you clean your mod before releasing it.
There are also changes that inexperienced mod authors make, like deleting content from a cell that they don't want. They don't realize that these deleted records will crash peoples' games. Why? Because you don't know if another mod is going to reference that record you deleted. If it does, boom! There is no authority that checks every mod that has ever been produced to ensure that they are all going to be compatible with each other, so it's incumbent on each mod author to restrict their changes to only the content they need to change and they never ever delete records from the game master plugins, like Oblivion.esm. I'll explain the proper way to handle stuff you don't want later in this guide. Why are Dirty Edits a Problem?
Basically as I just described above. Obviously deleted content is a serious problem, but even unintentional edits are a problem because they can prevent another mod from functioning properly. The last mod in a load order always wins, so if that mod has a dirty edit, that dirty edit will override the intentional edit of another mod and the other mod won't work.
Ok, so what happens when two mods make intentional changes to the same record? That's what the Bashed Patch is for. The Bashed Patch collects all the changes that mods make and combines those changes into a single patch that's loaded last in your load order. Cool, eh? You use Wrye Bash to create a Bashed Patch. See the Wrye Bash documentation for instructions, at least until I get my guide posted for doing that.
If the Bashed Patch can't handle the compatibility issues, then one of the mod authors involved usually creates a custom compatibility patch to resolve the issue. Cleaning Mods
In this guide, I will explain simple cleaning, cleaning mods with explicit dependencies, cleaning mods with implicit dependencies and manual cleaning. Simple Cleaning Level: Beginner
This is always the first step in cleaning a mod. It will remove what TESxEdit calls "Identical to master" records. These are records that have been flagged as modified, but haven't actually changed.
Run TESxEdit. When it opens, you will be presented with a dialog box to select the plugins you wish to work with. When cleaning a mod, it is vital that you only load the plugin that needs cleaning. In this simple case, the plugin has no other dependencies than the game master file(s).
Right-click on the dialog and click Select None from the menu.
Then scroll through the list and select the plugin you wish to clean. Click in the box to the left of the plugin to select it for loading. Click OK.
Now TESxEdit will proceed to load the plugin. You will see a bunch of messages scroll by in the right pane. Once it's done loading the plugin, the last message will say "Background Loader: finished".
Right-click on the plugin name in the left pane and select Apply Filter for Cleaning from the menu.
TESxEdit will pause for a few moments while it applies the filter. When it's done, the message at the bottom of the right pane will say "[Filtering done] Processed Records: xxxxxxx Elapsed Time: xx:xx" where the x's represent the number of records and the time it took.
Now right-click on the plugin name in the left pane again and select Remove "Identical to Master" records from the menu. Why doesn't it just say "Clean Plugin"? Because "cleaning" involves several steps. Removing the records with the false changed flag, or identical to master records, is just the first step.
Once TESxEdit is done, it will display the results in the right pane, like this:
The first step is complete. You can press CTRL+S to save the plugin at this point if you wish. Click OK in the dialog that pops up if you do. Simple Cleaning Step 2: Undelete and Disable
This is the second step in the simple cleaning process. If you've been reading from the beginning, you'll recall that I said that you should never delete anything from the game master files and that I would tell you how to handle content that you don't want in your mod. You have two options: disable the content yourself, or delete the content and then use TESxEdit to handle the deleted content properly. This is my recommendation. Yes, go ahead and delete the content in your mod, but clean it with TESxEdit and then perform the Undelete and Disable process as I will explain now.
Even if you're just running mods, it's a good idea to clean them and that includes this step. You never know if the mod author deleted something. It may not have even been intentional.
If you closed TESxEdit after the first step, open it again, deselect all mods and then select the mod that needs cleaning. Click OK to load the mod.
Right-click on the plugin name in the left pane and select Undelete and Disable References from the menu.
After a few seconds, you'll see the results at the bottom of the right pane:
All done! Now you can close TESxEdit. If it prompts you to save, click OK in the dialog that pops up.
If you're cleaning plugins for mods that you use, I suggest creating a folder somewhere called Cleaned Mods and keep a copy of the plugin in that folder. Then you know which mods need cleaning if you return to playing after being away for a while. BOSS and LOOT will also tell you if a mod needs cleaning, providing someone has told them about it. If you find a mod needs cleaning and BOSS or LOOT don't have a message about that, then please let them know.
Last note: Bethesda isn't innocent when it comes to dirty mods. The official DLC's for Oblivion and Skyrim need cleaning! Cleaning the official DLC's for Skyrim is a bit more work that I'll discuss later.