How to delete Word directories, including batch deletion
Explain clearly how to delete a Word directory: first delete the directory in a single document, then clear the remaining directory fields, and finally explain how to delete multiple documents in batches, and check whether the results are thorough.
Key points of this article
- The directory is usually a domain or content control. Selecting only the text will not delete it cleanly. You must select the entirety before deleting it.
- After deleting, use Ctrl+Shift+F9 to clear the remaining directory fields to avoid the directory appearing again when updating the fields later.
- Multiple documents can be processed one by one. When there are many files, use VBA macro to traverse the folder, but you must back it up before operating.
- After deletion, check the title style, page number and text to confirm that no content was accidentally deleted, then save and close
After many people use the citation function of Word to generate a table of contents, after a while they want to change the layout, or they no longer need the table of contents when they want to send a file to others, but they find that pressing Delete directly only deletes a few lines of text, but the table of contents is still there; or the table of contents appears again after being deleted, saved and opened again. The problem usually lies in the structure of the directory itself. It is not ordinary text, but a field that Word automatically generates based on the title and can be updated at any time.
This article is written for office users, students who need to delete directories, and people who often process a batch of reports. After reading, you will be able to distinguish several situations, including how to delete the Word directory in a single document, how to batch process multiple files, and how to check after deletion to ensure that the directory will not come back due to a certain "update domain".
Word versions and interfaces vary. The following are general ideas and shortcut keys. If the menu location is different, just search by the function name.
How to delete the directory to make it clean? One sentence conclusion
To delete a directory directly, the key is to treat it as a whole instead of deleting text line by line. For a single document, first select the entire table of contents and delete it, and then clear the remaining fields; batch process multiple documents with macros, and after deletion, check whether the title style and page number are still remaining.
| your situation | Recommended practices | reason |
|---|---|---|
| There is only one document with a complete directory, so there is no need for it. | Select the directory as a whole and press the Delete key, then clear the remaining fields. | The table of contents is a field. Deleting it line by line will leave blank paragraphs or field codes. |
| The table of contents has been changed to ordinary text and cannot be updated. | Directly select and delete, and then check whether there are any blank paragraphs | The domain has been converted to text and does not require additional unlinking |
| Several documents have the same format and are not many in number | Open them one by one and apply the same set of steps | When the quantity is small, processing one by one is more intuitive and easy to check. |
| There are more than dozens of copies in the entire folder | Use VBA macro to traverse folders and delete them in batches. Try running on the copy first. | Manual repeated operations can easily miss files and steps. |
| The directory is deleted and reappears | Check if any other table of contents fields, headers, footers or templates are still inserted into the table of contents | The remaining fields have been updated, or the template has its own directory. |
Before you start: Confirm these points first
- Back up the original file first. After batch operations are saved, the original content is difficult to retrieve. Copy the file to a separate folder and try the effect on the copy. Deleting the directory itself will not affect the text, but if the macro runs incorrectly or the text is accidentally deleted, the original file is the final remedy.
- Confirm the type of directory. Put the cursor into the directory. If the entire block appears with gray shading, it means it is a field or content control and needs to be processed as a whole. If it can be selected line by line like ordinary text, it is probably pure text.
- Confirm whether you want to keep the title style. The table of contents is generated based on the title style. Deleting the table of contents will not delete the title style. If you need to use the navigation pane or regenerate the table of contents in the future, you will need to retain these heading styles.
- Confirm the file format and macro permissions. Ordinary .docx files do not save macros. Batch processing usually requires running scripts in documents or templates with macros, and needs to be allowed to run in Word's macro security settings.
- Confirm whether the table of contents is in the header, template or other content control. Table of contents are sometimes placed in headers, templates or other content controls. Only delete the table of contents in the text. Table of contents in these places will appear again and need to be checked together.
Steps to delete a table of contents in a single Word document
- Open the Word document, place the cursor anywhere in the directory, and observe whether a gray shading or outer frame appears to determine whether it is a field or ordinary text.
- Drag from the first row of the directory to the last row, or move the mouse to the blank space on the left side of the directory and click and drag to select the entire directory area.
- Press the Delete key to delete. If the word "Table of Contents" is a separate paragraph, or there are section breaks around the table of contents, select and delete them as well.
- Press Ctrl+A to select all, and then press Ctrl+Shift+F9 to unlink the remaining fields in the document and convert them to ordinary text. NOTE: This step affects all fields, such as cross-references. If there are still fields in the document that need to be retained, do not select them all and process them one by one instead.
- Press Alt+F9 to toggle display of field codes. If you can still see code starting with "TOC", it means there are still residues. Select it to delete it, and then press Alt+F9 to switch back to normal display.
- Save the document, close and reopen it, and confirm that the table of contents does not reappear due to updating the fields.
📊 Core comparison
There are three common ways to delete directories in batches. You can choose according to the number of files and your own proficiency.
| Way | Suitable situation | Things to note |
|---|---|---|
| Open one by one and process in single document steps | There are only a few documents | The speed is slow, but you can see the results directly in each copy |
| Traverse folders with VBA macro in Word | There are many files and uniform format in the same folder. | You need to allow macros to run and test with copies first to avoid mishandling extraneous files. |
| Write down the steps in a fixed list and apply them one by one | There are many files, but I don't want to write a script. | It is easy to miss a step and needs to be used in conjunction with the checklist |
The idea of batch deletion with macros is: in Word, press Alt+F11 to open the VBA editor, create a new module, write a cycle, open the .docx file in the specified folder in turn, delete all directories for each document (traversing the document directory set and delete one by one), and then perform the operation of clearing the residual domain, and finally save and close. Before running, change the folder to a copy directory and test it with two or three files. The writing of macros varies slightly with the Word version. If you are not familiar with it, you can ask colleagues who know how to program to check it and then run it. It should be noted that the macro will modify and save the file, and all .docx in the folder will be processed, so you should only put in the files that need to be processed.
# check item by item after completion
After you get the results, check them item by item according to the table below.
| Check item | What do you think? | What if there's a problem? |
|---|---|---|
| Whether the directory has disappeared | Turn it over from beginning to end and look at the beginning, header and footer | Re-select the residual area deletion and check the domain code with Alt+F9 |
| Will the directory appear again? | Save, close, reopen, then press Ctrl+An and then press F9 to update the domain | Indicates that there is a directory domain. Press Alt+F9 to find the TOC code and delete it. |
| Has the text been mistakenly deleted | Check the number of headings and paragraphs against the backup copy | Copy back the mistakenly deleted part from the backup |
| Title style and page number | See if the title still has a style and whether the page number is continuous. | Check section breaks and page number settings when the page number is abnormal |
| Batch result | Randomly check several copies to see if all the catalogs have been deleted | Handle the missing files separately and record the file name |
# frequently asked questions (FAQ)
1. After the catalogue is deleted, do you still have the page number and title?
The title text and title style are still there, and deleting the directory only removes the automatically generated part of the content. The page number is determined by the header, footer and section settings, has nothing to do with the catalog, and usually remains the same after deletion.
2. Will the bulk deletion of the directory delete the text as well?
As long as macros perform deletions only on directory objects, the body is not affected. However, if the script is incomplete, or if the folder is mixed with files that should not be processed, false deletions may occur. So be sure to run it on the backup copy first.
3. Can't write macros, is there any other way to delete them in batches?
You can organize the steps of a single document into a fixed list, apply them one by one, and tick each document after processing. When there are a large number of files, this approach is slower, but it does not need to write code, which is safer.
4. After deleting the directory, will the cross-references in the file become invalid?
If you use full plus Ctrl+Shift+F9 in step 4, the cross-references in the document will be converted to normal text and cannot be updated automatically. If you still need these references, only deal with the directory fields one by one, not all.
# Summary
The key to deleting the Word directory is to select it as a whole, clear the remaining fields, and then check to see if any other locations are still inserting the directory. A single document can be processed step by step, and multiple files can be manipulated in bulk with macros, but be sure to back up and test on the copy first. After completion, check item by item to ensure that the catalogue is deleted completely and the text is complete.


