When organizing a large number of Word, docx, or doc documents, if you need to delete all entire paragraphs that contain a specific keyword, opening each file to search and manually delete them is very time-consuming and prone to omissions. This article takes appendix paragraphs such as "Annex A, Annex B, Annex C" as an example to introduce how to use HeSoft Doc Batch Tool to batch match paragraphs containing keywords through wildcard regular expressions, and leave the replacement content blank to achieve deletion, suitable for scenarios such as directory cleanup, template simplification, and sensitive content removal.
In daily office work, many people encounter similar issues: a batch of Word documents containing certain unnecessary paragraphs, such as appendix descriptions starting with "Annex A," "Annex B," "Annex C," template residual text, outdated clauses, fixed prompts, or entire paragraphs containing specific keywords. If there's only one document, you can manually find, select, and delete the paragraphs in Word; but when the number of files increases to dozens or hundreds, and even each docx document contains multiple similar pieces of content, manual processing is not only inefficient but also prone to missed or incorrect deletions.
The core problem this article aims to solve is: How to use wildcard regular expressions to batch delete all paragraphs containing keywords in Word. The office software used here is " HeSoft Doc Batch Tool ", which is positioned as a batch processing tool for office files such as Word, Excel, PowerPoint, and PDF. Its key value lies in reducing repetitive operations, unifying processing rules, and completing multi-file tasks at once. Combining screenshots, this article will use the example of batch deleting complete paragraphs containing keywords like "Annex A" to "Annex Z" in Word documents to illustrate the complete workflow from selecting the function, adding files, setting wildcard regular expressions, to viewing the processing effect.
Applicable Scenarios: Situations Suitable for Batch Deleting Word Paragraphs Containing Keywords
"Deleting complete paragraphs containing keywords" is not simply replacing a word with nothing; it is better suited for scenarios requiring content cleanup at the paragraph level. For example, a document's table of contents or body might have several lines of appendix entries starting with "Annex A" or "Annex B," and you want to delete the entire line rather than just the characters "Annex A"; or contracts, policies, manuals, and thesis materials might contain fixed disclaimers, historical version notes, repetitive footer text, or expired clauses—whenever a specified keyword appears in a paragraph, that entire paragraph needs to be removed from the Word document.
This requirement is common in the following office scenarios: First, batch cleaning of appendix directory entries in docx files, such as deleting all paragraphs like "Annex A - xxx" and "Annex B - xxx"; second, batch deleting placeholder instructions in doc or docx templates, such as entire paragraphs containing "Please fill in here," "Internal use only," or "For reference only"; third, batch processing Word documents converted from web pages or PDFs to remove paragraphs containing advertisements, source statements, or copyright notices; fourth, uniformly clearing old version chapter descriptions from multiple reports to avoid manual checking file by file.
If processing only a short document, manual operation might be tolerable; but when facing multiple Word files in a folder, the advantage of using HeSoft Doc Batch Tool is obvious: by setting a rule once and applying it to multiple files in batch, you reduce repetitive work and ensure more consistent processing logic.
Effect Preview: Before Processing, Multiple Annex Paragraphs Exist in Word
From the pre-processing screenshot, you can see that below the "Annexes" heading in the Word document, there are multiple appendix entries, including "Annex A," "Annex B," "Annex C," and "Annex D." These paragraphs are followed by various descriptive texts, such as food and beverage standards, school meal analysis, common questions, and sugar explanations. If the user's goal is to delete all appendix paragraphs starting with Annex followed by a capital letter, deleting them line by line would be very cumbersome, especially when they repeat across multiple Word files, significantly increasing the manual processing cost.

Note that what the red boxes in the screenshot mark are not just single words but multiple complete paragraphs. The method described in this article uses the "Find and Replace Complete Paragraphs in Word Based on Keywords" function to delete the entire paragraphs containing specified patterns. Since the replaced content is empty, the final effect is the removal of the paragraphs.
Effect Preview: After Processing, Paragraphs Containing Annex A to Annex D Have Been Deleted
In the post-processing screenshot, the "Annexes" heading is still retained, but the paragraphs originally containing "Annex A," "Annex B," "Annex C," and "Annex D" below it are no longer displayed. This means the software did not delete the entire heading area but rather deleted the matched complete paragraphs according to the set keyword rules. For document organization tasks that require retaining chapter titles and only cleaning specific entries below them, this method is more precise than deleting an entire page or manually selecting areas.

From the before-and-after comparison, it's evident that the role of wildcard regular expressions is to help users cover a category of text with a single rule. For instance, "Annex [A-Z]" can be used to match situations where Annex is followed by a capital English letter, thus covering similar content like Annex A, Annex B, and Annex C. For batch processing Word, docx, and doc files, this rule-based approach is more efficient than manually entering keywords one by one.
Operation Step 1: Enter the Word Tool and Select the Find and Replace Complete Paragraphs Feature
After opening HeSoft Doc Batch Tool , you can see multiple tool categories on the left, including Home, Task Flow, All Tools, File Name, Folder Name, File Organization, Word Tools, Excel Tools, PowerPoint Tools, PDF Tools, etc. As the current processing target is a Word document, you need to enter the "Word Tools" category.
On the Word Tools page, select the "Find and Replace Complete Paragraphs in Word Based on Keywords" function. In the screenshot, this function is the second item, described as "Batch delete entire paragraphs containing a certain keyword in Word files or replace them with new text." This perfectly matches the needs of this article: we are not replacing a single word but deleting the entire paragraph containing the keyword.

The purpose of this step is to select the correct processing module. Many users confuse "Find and Replace Keywords in Word" with "Find and Replace Complete Paragraphs in Word Based on Keywords." The former is generally better suited for replacing words themselves, while the latter is better for cleaning content by paragraph. This article aims to achieve "Word batch delete paragraphs containing keywords," so the complete paragraph processing function should be chosen.
Operation Step 2: Add the Word Files to Be Batch Processed
After entering the function page, the software follows a wizard-like flow. The top of the screenshot shows the current function name is "Find and Replace Complete Paragraphs in Word Based on Keywords," and the flow includes stages such as "Select Records to Process," "Set Processing Options," "Set Save Location," and "Start Processing." The first step is to add the Word files to be processed.
On the upper right of the page, you can see buttons like "Add Files," "Import Files from Folder," "Clear," and "More." For a small number of files, you can use "Add Files"; for processing a large number of docx or doc files in a folder, use "Import Files from Folder." The screenshot shows that 5 Word files have been added, named 1.docx, 2.docx, 3.docx, 4.docx, and 5.docx, with the list showing file path, extension, creation time, modification time, and other information.

The purpose of this step is to confirm that all Word documents from which paragraphs need to be deleted have been added to the pending list. Before processing, it is recommended to check the file count, file names, and paths for correctness to avoid missing files. After confirmation, click "Next" at the bottom to enter the processing rule settings page.
Operation Step 3: Choose Fuzzy Text Search Using Formula and Enter the Wildcard Regular Expression
On the "Set Processing Options" page, you need to configure the keyword search rule. The "Search Method" area in the screenshot offers two options: "Exact Text Search" and "Fuzzy Text Search Using Formula." Since this example aims to delete a series of similar paragraphs like Annex A, Annex B, Annex C, and Annex D, entering keywords one by one would be cumbersome, so "Fuzzy Text Search Using Formula" is selected.
Enter: Annex [A-Z] in the "List of Keywords to Find." This expression can be understood as: find content containing "Annex" followed by a capital English letter. This way, any paragraph containing patterns like Annex A through Annex Z will be identified as a matching paragraph.

On the right side of the screenshot is the "List of Keywords for Replacement," with a note saying "Leave blank to delete." The goal in this example is to delete entire paragraphs containing the keyword, so the replacement content on the right should be left empty. That is, after the software finds a paragraph containing the "Annex [A-Z]" pattern, it will not replace it with new text but directly delete the entire paragraph.
This step is critical. Users should adjust the expression based on their actual document content: for deleting paragraphs containing fixed words, use more specific keywords; for deleting a category of similarly patterned paragraphs, use wildcard regular expressions like in the screenshot. Once set, click "Next" to proceed to the save location settings, then follow the wizard to "Start Processing."
Operation Step 4: Set Save Location and Start Batch Processing
The process bar in the screenshot shows that after completing processing options, you need to go through "Set Save Location" and "Start Processing." Although the subsequent pages are not expanded in the screenshot, it can be reasonably inferred from the wizard flow that users need to continue following the on-page prompts to set the save location for the processed files and launch the batch processing task.
The purpose of this step is to prevent the processed results from overwriting or being confused with the original files. For important Word documents, it is recommended to save the processed files to a separate directory for easy comparison with the originals. Once the rules are confirmed, execute the batch process. After completion, open the output docx documents to check the results, focusing on whether the target keyword locations have been deleted as expected.
Key Points for Setting Wildcard Regular Expressions
In this example, "Annex [A-Z]" is entered in the keyword list. Here, "Annex" is the fixed text, and "[A-Z]" represents a capital English letter. Combined, they can match text like Annex A, Annex B, and Annex C. Since this function processes "complete paragraphs," any paragraph containing matching content will be deleted entirely.
When using such rules, it's advisable to test with a small number of files first. For instance, add one docx document, confirm the deletion effect meets expectations, and then import the entire folder for batch processing. This avoids overly broad expressions that could lead to accidental deletions. For example, a keyword set too generally might match paragraphs in the body text that need to be kept. Therefore, the expression should reflect the unique characteristics of the target paragraphs as much as possible.
Common Questions and Considerations
1. Why not just use Word's built-in Find and Replace? Word's built-in Find and Replace is suitable for processing within a single document, but if you need to apply the same rule to multiple Word, docx, or doc files, you would have to repeatedly open, find, replace, and save. HeSoft Doc Batch Tool 's value lies in consolidating these repetitive actions into a single batch task.
2. Why leave the replacement keyword list empty? As the prompt in the screenshot shows, the "List of Keywords for Replacement" area is marked "Leave blank to delete." Therefore, when the goal is to delete paragraphs, simply leave the right side's replacement content empty. If text were filled in, it would be more suitable for replacing the matching paragraphs with new content.
3. Will the title "Annexes" be deleted? The search rule used in this example is "Annex [A-Z]", while the title is "Annexes," and the two are different. From the post-processing screenshot, the Annexes heading is retained, indicating that paragraphs matching patterns like Annex A, Annex B are deleted, not the entire appendix title area.
4. Is a backup necessary before batch processing? A backup is recommended. Even though the software provides a save location setting, it's important to keep the original versions of important files before batch processing. Especially when using wildcard regular expressions, it's best to validate the rule with a test file first.
5. Can both doc and docx be processed using this approach? The sample file extension in the screenshots of this article is docx. For the idea of batch cleaning Word documents, both doc and docx are common target formats. In actual processing, the import and recognition results of the software should prevail; first confirm that the files have been added to the list normally.
Summary: Use Batch Tools to Reduce Repetitive Work in Word Paragraph Cleaning
The most important points for batch deleting all paragraphs containing keywords in Word are: First, choose a paragraph-based processing function like "Find and Replace Complete Paragraphs in Word Based on Keywords"; second, set an appropriate wildcard regular expression based on the document pattern and leave the replacement content empty to achieve deletion. Through HeSoft Doc Batch Tool , users can transform the original process of opening Word files one by one, searching and deleting paragraph by paragraph, into a single workflow of importing files, setting rules once, and executing in batch.
If you are organizing a large number of docx and doc documents and need to delete paragraphs containing fixed keywords, numbers, appendix identifiers, or template residual text, you can first select a small number of files to test the expression, then import the entire folder for batch processing. This not only improves efficiency but also reduces the risk of human omission and format disorder.