Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ the Key column.

[--new=<value>]
An alternative way to specify the replacement string. Use this when the
replacement string starts with '--' (e.g., --new='--other-text').
replacement string starts with '--' (e.g., --new='--other-text') or is
empty.

[--dry-run]
Run the entire search/replace operation and show report, but don't save
Expand Down Expand Up @@ -158,6 +159,9 @@ the Key column.
# Search/replace string containing hyphens
$ wp search-replace --old='--old-string' --new='new-string'

# Remove a string by replacing it with an empty value
$ wp search-replace --old='remove-me' --new=''

# Use precise mode for complex serialized data
$ wp search-replace 'oldurl.com' 'newurl.com' --precise

Expand Down
6 changes: 5 additions & 1 deletion src/Search_Replace_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class Search_Replace_Command extends WP_CLI_Command {
*
* [--new=<value>]
* : An alternative way to specify the replacement string. Use this when the
* replacement string starts with '--' (e.g., --new='--other-text').
* replacement string starts with '--' (e.g., --new='--other-text') or is
* empty.
*
* [--dry-run]
* : Run the entire search/replace operation and show report, but don't save
Expand Down Expand Up @@ -275,6 +276,9 @@ class Search_Replace_Command extends WP_CLI_Command {
* # Search/replace string containing hyphens
* $ wp search-replace --old='--old-string' --new='new-string'
*
* # Remove a string by replacing it with an empty value
* $ wp search-replace --old='remove-me' --new=''
*
* # Use precise mode for complex serialized data
* $ wp search-replace 'oldurl.com' 'newurl.com' --precise
*
Expand Down
Loading