← BACK TO HELP
How does the Dry-Run with Preview Works?
The Dry-Run with Preview feature in Block Editor Search & Replace Pro provides a safe and reliable way to test your changes before applying them. This functionality ensures that your edits are precise and error-free, giving you peace of mind when making changes to your WordPress content. In this post, we’ll explore how the Dry-Run with Preview feature works, its configuration options, and step-by-step usage, along with useful external resources to help you make the most of it.
Why Use the Dry-Run Feature?
Editing content directly can be risky, especially when dealing with bulk changes. The Dry-Run with Preview feature mitigates this risk by allowing you to review changes in a sandbox environment before they are applied to your live content.
Key Benefits:
- Error Prevention: Test changes without altering the original content.
- Visual Feedback: See the highlighted changes in a preview format.
- Supports Multiple Formats: Works seamlessly with text, images, links, and multiple terms.
- Selective Application: Apply changes only after confirming they are accurate.
For a detailed overview of content editing best practices, check out WordPress Editing Tips.
How to Enable Dry-Run as Default
To streamline your workflow, you can enable the Dry-Run feature by default from the plugin’s Options page.
Steps to Enable:
- Navigate to the Options section in the plugin menu.
- Locate the Dry-Run Settings option.
- Set Dry-Run to “Yes” to enable it by default.
Once enabled, every search and replace operation will run in dry-run mode unless explicitly turned off.
How the Dry-Run Process Works
The Dry-Run with Preview feature is designed to ensure no changes are made to your live content until you confirm them.
Key Workflow:
- Initiate a Search: Perform a search for the desired text, image, link, or multiple terms.
- External Table for Previews:
- The plugin creates a copy of the post with highlighted matches.
- This preview is stored in an external table, leaving the original post unchanged.
- Open Preview Changes:
- Click the Preview Changes button.
- A modal window will open, displaying a minimally formatted preview of the changes.
- Apply Changes:
- If satisfied with the preview, click the Apply Changes button to implement the edits on the original post.
- Final Replace Action:
- Add the replacement input and click the Replace button to finalize the operation.
For more information on how to create and manage backups for added safety, read this WordPress Backup Guide.
Supported Search Methods
The Dry-Run with Preview feature works seamlessly with the following search methods:
- Text: Highlights and previews text changes without modifying the original content.
- Images: Ensures image URLs are correctly identified and previewed before replacement.
- Links: Updates link URLs with accurate previews.
- Multiple Terms: Handles multiple search terms simultaneously, highlighting each instance.
Unsupported Methods
- Shortcodes, HTML, and RegExp: These advanced search methods fall under Expert Mode and do not support dry-run previews. To learn more about using regular expressions in WordPress, check out Regex101.
Step-by-Step Guide to Using Dry-Run with Preview
Here’s a detailed guide to performing a dry-run operation using the plugin:
Step 1: Perform a Search
- Enter your search query in the plugin’s search field.
- Choose your desired search method (text, image, link, or multiple terms).
Step 2: View Highlighted Results
- After running the search, the plugin generates a copy of the post content with highlighted matches.
- This copy is stored in an external table, ensuring no changes are made to the original post.
Step 3: Open the Preview Changes Modal
- Click the Preview Changes button.
- A modal window will appear, showing the proposed changes with minimal formatting.
Step 4: Review and Apply Changes
- Carefully review the highlighted changes in the modal.
- If satisfied, click the Apply Changes button to implement the edits on the live content.
Step 5: Replace Content
- Enter the replacement input in the provided field.
- Click the Replace button to finalize the operation.
For more on working with modals in WordPress, visit this helpful guide: Using Modals in WordPress.
Practical Use Cases for Dry-Run
The Dry-Run with Preview feature is useful in various scenarios:
Bulk Editing Text Content
- Preview changes to text across multiple posts to ensure consistent formatting and accuracy.
- Ideal for rebranding or updating outdated terms.
Updating Image URLs
- Verify image URL replacements during site migrations or CDN changes.
- Prevent broken links by testing changes before applying them.
Fixing Broken Links
- Identify and replace broken links with accurate URLs.
- Use the preview to confirm that the correct links are updated.
Managing Multiple Terms
- Update multiple keywords simultaneously, ensuring all instances are correctly identified and replaced.
For tips on fixing broken links, refer to How to Fix Broken Links in WordPress.
FAQs
Can I Skip the Dry-Run Process?
Yes, you can disable dry-run mode for individual operations, even if it’s set as the default.
What Happens to the Preview Data?
Previews are stored in an external table and do not modify the original post content until changes are applied.
Can I Undo Changes After Applying Them?
Yes, by using the plugin’s Backup and Restore feature. Learn more about backups in this guide.
Why Dry-Run Matters
The Dry-Run with Preview feature is a critical component of Block Editor Search & Replace Pro, offering:
- Safety: No changes are made until you approve them.
- Clarity: See exactly how your changes will look before they are applied.
- Flexibility: Works with multiple content types for versatile editing.
The Dry-Run with Preview feature in Block Editor Search & Replace Pro is an essential tool for anyone who values precision and control in content editing. Whether you’re updating text, images, or links, this feature ensures your changes are accurate and risk-free.