This article explains how to use HeSoft Doc Batch Tool to batch delete entire paragraphs containing specified keywords from multiple Word, docx, and doc files. In the example, wildcards like "Annex [A-Z]" are used to match paragraphs such as Annex A, Annex B, Annex C, and the replacement content is left empty to achieve whole paragraph deletion. This is suitable for cleaning up repetitive content like tables of contents, appendices, disclaimers, and fixed explanatory text, reducing manual operations of opening files one by one for search and deletion.
When organizing Word documents, translating materials, report templates, or batch-delivered docx files, you often encounter a repetitive but very time-consuming task: certain paragraphs need to be deleted entirely as long as they contain specified keywords. For example, if a table of contents page has appendix entries like Annex A, Annex B, Annex C, Annex D, manual processing usually requires opening each Word file individually, searching for the keyword, selecting the entire paragraph, and then deleting it. If the number of files reaches dozens or even hundreds, such operations are not only slow but also prone to missed or incorrect deletions.
The problem this article aims to solve is: how to use the batch processing function in office software to delete all complete paragraphs containing keywords in Word at once through wildcard or regex-like matching. The software used in the example is " HeSoft Doc Batch Tool " shown in the screenshot. Its positioning is a document batch processing office software, suitable for performing repetitive organization tasks on Word, docx, doc, and other file types.
Applicable Scenarios: Which Word Paragraphs Are Suitable for Batch Deletion by Keyword
"Deleting an entire paragraph containing a keyword" does not mean just deleting a few words, but deleting the whole paragraph that contains the keyword. This capability is suitable for handling content with obvious identifiers, such as appendix items in a table of contents, fixed disclaimers in reports, placeholder descriptions in templates, certain types of notes in contracts, answer analysis sections in exam papers, exported system prompt messages, etc.
If the content to be deleted has common patterns, you can consider using wildcard expressions. For example, in the example, the paragraphs start with Annex A, Annex B, Annex C, Annex D, and their common feature is "Annex + space + one uppercase letter". In this case, you don't need to write Annex A, Annex B, Annex C one by one; you can use an expression like Annex [A-Z] for fuzzy matching.
This type of batch processing is particularly suitable for the following situations: first, when multiple docx files have similar structures and need unified cleanup; second, when the keyword location varies in each Word file, making manual location tedious; third, when you want to delete the complete paragraph, not just the keyword itself; fourth, when you need to quickly remove unnecessary entries while preserving the main text structure.
Effect Preview: Paragraphs Containing Annex A to Annex D Before Processing
From the screenshot before processing, we can see that under the "Annexes" heading in the Word document, there are multiple appendix paragraphs, including Annex A, Annex B, Annex C, Annex D, etc. These paragraphs are followed by descriptive text, such as food and beverage standards, analytical meals, frequently asked questions, carbohydrate descriptions, etc. The red boxes and arrows mark the target content that needs to be cleaned up.

If processed manually, you would need to select and delete each Annex paragraph; if there are 5, 50, or even more similar files, the repetitive operation would be very inefficient. More importantly, when deleting manually, it is easy to delete only the keyword and miss the subsequent text in the paragraph, or miss Annex entries in some files.
Effect Preview: After Processing, Only the Annexes Heading Remains, Target Paragraphs Deleted
The screenshot after processing shows that the "Annexes" heading is still retained, but the paragraphs originally containing Annex A, Annex B, Annex C, Annex D below it have been deleted. That is to say, this operation is not about deleting the entire appendix title area, but only deleting the complete paragraphs matching "Annex + letter", achieving the goal of batch cleaning specified paragraphs.

This processing result is suitable for scenarios where you need to retain chapter titles, directory structures, or context, but want to delete certain specific entries. By setting a keyword list and leaving the replacement content empty, the software will remove the matched complete paragraphs, thereby reducing the workload of manual deletion one by one.
Step One: Enter the Word Tool and Select "Find and Replace Complete Paragraphs in Word by Keyword"
After opening " HeSoft Doc Batch Tool ", select "Word Tools" in the left navigation bar. The main interface will display multiple Word-related batch functions, including Find and Replace Keywords, Add Watermark, Delete Pictures, Convert Format, etc. According to the screenshot, the function to be used this time is the second one: Find and Replace Complete Paragraphs in Word by Keyword.

The key point of this function is "complete paragraphs". Ordinary find and replace usually only replaces a certain word or a piece of text, but the goal here is: as long as a paragraph contains a keyword that meets the criteria, the entire paragraph can be replaced or deleted. For cleaning up Word directory items, appendix items, template descriptions, etc., this is more in line with actual office needs than finding keywords one by one.
After clicking this function card, you enter the batch processing flow. The interface adopts a step-by-step design, and the processing flow at the top can be seen, including "Select Records to Process", "Set Processing Options", "Set Save Location", "Start Processing". This process is suitable for batch file operations, allowing you to confirm the file list first, then set matching rules, and finally output results uniformly.
Step Two: Add the Word Files to Be Batch Processed
After entering the function page, the first step is to select the records to be processed. In the screenshot, you can see buttons like "Add File", "Import Files from Folder", "Clear", "More" in the upper right corner. For a small number of files, you can use "Add File"; if you want to process docx or doc files in an entire folder, you can use "Import Files from Folder".

After adding files, the list will display information such as serial number, name, path, extension, creation time, and modification time. In the example, 5 files have been added: 1.docx, 2.docx, 3.docx, 4.docx, 5.docx, located under the D:\test\ directory. It is advisable to check if the number and paths of files are correct here, to avoid adding Word documents that should not be processed into the task.
If a file should not be processed, it can be removed via the delete icon on the right side of the list; if the list is completely wrong, you can also use "Clear" to re-add. After confirming the file list is correct, click "Next" at the bottom to enter the processing option settings.
Step Three: Set Wildcard Expressions to Match Complete Paragraphs Containing Keywords
On the "Set Processing Options" page, you need to configure the search method and keywords. In the screenshot, the "Search Method" provides two options: "Precise Text Search" and "Fuzzy Text Search Using Formulas". Since this example needs to match text with patterns like Annex A, Annex B, Annex C, you should select Fuzzy Text Search Using Formulas.

Enter in the "Keyword List to Find":
Annex [A-Z]
This expression can be understood as: matching text starting with Annex plus a space, plus any uppercase letter from A to Z. Therefore, Annex A, Annex B, Annex C, Annex D will all be identified as target keywords. Since the current function processes "complete paragraphs", as long as a paragraph contains this matching content, the entire paragraph will be treated as the processing target.
On the right is the "Replacement Keyword List". The prompt above this area in the screenshot says "Leave blank to delete". Therefore, if the goal is to batch delete paragraphs containing keywords, just leave the replacement content on the right empty. This way, when the software executes, it will not replace the paragraphs with new text but directly delete the matched complete paragraphs.
If your keyword case is not fixed, you can pay attention to the "Ignore Letter Case" option based on actual needs. In the example, the expression uses the uppercase range [A-Z], which is suitable for matching standardized writing like Annex A. If the file may contain different writings like annex a, ANNEX A, you need to adjust the rules or enable relevant additional options based on the actual content.
Step Four: Set Save Location and Start Processing
After completing the keyword and replacement rule settings, click "Next" to enter "Set Save Location". Since batch modification of Word files carries irreversible risks, it is recommended not to overwrite the original files directly, but to output to a new folder. This way, even if the expression settings do not meet expectations, you can go back to the original docx files and process again.
Then enter the "Start Processing" step. After confirming the task list, keyword expressions, and save location, execute the batch processing. After processing is complete, open the output files for spot-checking, focusing on checking whether paragraphs containing keywords like Annex A, Annex B have been deleted, and whether non-target content such as main text, titles, and directories remains normal.
From the post-processing effect image, it can be seen that the Annexes heading still exists, but the specific paragraphs from Annex A to Annex D have been removed, indicating that the expression matching and entire paragraph deletion achieved the expected effect.
Frequently Asked Questions and Notes
1. Why choose "Fuzzy Text Search Using Formulas"?
If you only delete one fixed word, for example, only delete paragraphs containing "Annex A", you can use precise search. But when the target has a pattern, such as Annex A to Annex Z, numbers 1 to 9, a certain type of date or code, using fuzzy text search with formulas can reduce repetitive input and improve the universality of the rule.
2. Why should the replacement keyword list be left blank?
The screenshot clearly prompts "Leave blank to delete". The goal of this example is to delete complete paragraphs, so the right-side replacement content is not filled in. If new text is filled in, it would be closer to replacing the matched paragraph with specified content, rather than deleting it.
3. Will the "Annexes" heading be deleted?
The expression in this example is Annex [A-Z], which requires Annex followed by a space and an uppercase letter, while "Annexes" does not match this pattern, so the heading is retained after processing. When setting rules, try to make the expression only match the characteristics of the target paragraphs to avoid being too broad.
4. Can both doc and docx be processed with a similar approach?
From the tool page, this function is geared towards batch processing of Word files. In actual use, you can add docx, doc, and other Word documents according to the file extensions supported by the software. It is recommended to test with a small number of samples first, confirm the output effect, and then batch process all files.
5. Do I need a backup before batch deletion?
Backup is recommended. Especially when using wildcard or regex-like rules, a single space, range, or case setting can affect the matching results. Saving the results to a new directory is a safer office processing habit.
Summary: Use Batch Processing Software to Reduce Repetitive Deletion Work in Word
Batch deleting all paragraphs containing keywords in Word essentially hands over the repetitive actions of "find, select paragraph, delete, save" to office software for automatic completion. Through the "Find and Replace Complete Paragraphs in Word by Keyword" function of HeSoft Doc Batch Tool , you can uniformly apply rules to multiple docx and doc files, particularly suitable for cleaning up patterned paragraphs like Annex A, Annex B.
If you are processing a large number of Word documents, it is not recommended to continue opening files one by one for manual deletion. You can first prepare 1 to 2 sample documents, set wildcard expressions, output to a new folder, confirm correctness, and then expand to the entire batch of files. This can both improve efficiency and reduce the risk of missed or incorrect deletions.