How to Keep Conditional Content in a Word Mail Merge
Question details
The user needs to conditionally include or remove paragraphs in a merged document based on data-source values, as standard cross-reference fields are unlinked after merging.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Completing a mail merge where specific paragraphs should only appear based on certain data source criteria.
- Observed behavior
- After the mail merge finishes, update fields used for cross-referenced paragraphs are unlinked and no longer available, preventing dynamic content generation.
Ensure your data source, such as an Excel spreadsheet, contains a specific column that can serve as the condition criterion for the text you want to include or exclude.
Use an IF Field to Control Conditional Paragraphs
Instead of relying on cross-references that get unlinked, embed your conditional paragraphs directly inside an IF field in the primary merge document.
When Word merges into a new document, it typically unlinks most fields, leaving only their static text results. To maintain dynamic content, you must use Mail Merge Rules (specifically the 'If...Then...Else' rule) tied directly to a criterion field in your data source.
Open your data source spreadsheet and add a specific criterion column, such as 'IncludeParagraph', with values like 'Yes' or 'No' for each recipient.
In your main merge document, navigate to the Mailings tab, click the 'Rules' dropdown button, and select 'If...Then...Else...'.
In the dialog box, select your criterion field name from the Field Name dropdown, choose 'Equal to' for the comparison, and type the target value (e.g., 'Yes').
Type the paragraph you want to include in the 'Insert this text' box for the true condition, and leave the false box blank (or add alternative text). Click OK.

Perform Conditional Mail Merges in WPS Writer
WPS Writer offers a comprehensive and intuitive Mail Merge feature that supports complex rules, including If...Then...Else conditions, allowing you to generate dynamic documents effortlessly.
- 1. Open WPS Writer: Launch WPS Writer and open your main document template.
- 2. Link Data Source: Navigate to the Mailings tab, click 'Open Data Source', and select your Excel spreadsheet.
- 3. Insert Conditional Rule: Click 'Rules' in the Mailings tab, choose 'If...Then...Else...', and set your criteria and conditional text.
- 4. Finish and Merge: Click 'Merge to New Document' to generate the final files with the correct conditional paragraphs included.

Frequently Asked Questions
Why do my cross-references break after a mail merge?
When a word processor completes a merge into a new document, it updates and unlinks most fields (converting them to plain text) to prevent the final document's content from changing unexpectedly if the source is moved. This behavior breaks dynamic cross-references.
Can I insert multiple paragraphs inside a single IF field?
Yes. Press Alt + F9 to reveal the field codes. You can then hit 'Enter' and paste multiple paragraphs directly inside the quote marks of the true or false results within the { IF } field code.
What if my conditional text contains other merge fields?
You can nest merge fields inside the true or false text results of an IF field. Toggle field codes (Alt + F9) and manually insert the necessary merge fields using Ctrl + F9 inside the quote marks of the desired condition.




