Skip to content

Commit 5aad9bf

Browse files
added search and replace quick start & adding new command (#515)
* added search and replace quick start & adding new command * Edit `wp search-replace` example to fit others; remove custom command --------- Co-authored-by: Daniel Bachhuber <[email protected]>
1 parent 2a49729 commit 5aad9bf

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

quick-start.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,20 @@ Found 1 image to regenerate.
125125
Success: Finished regenerating the image.
126126
```
127127

128-
Wondering what's next? Browse through [all of WP-CLI's commands](https://developer.wordpress.org/cli/commands/) to explore your new world. Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities.
128+
**Search and replace URLs**
129+
130+
If you're moving a database from one domain to another, `wp search-replace` ([doc](https://developer.wordpress.org/cli/commands/search-replace/)) makes it easy to update all URL references in your database.
131+
132+
To see which links will be replaced in your database, use the --dry-run flag:
133+
134+
```
135+
wp search-replace 'http://oldsite.com' 'http://newsite.com' --dry-run
136+
```
137+
138+
When ready to replace the links, run:
139+
140+
```
141+
wp search-replace 'http://oldsite.com' 'http://newsite.com'
142+
```
143+
144+
Wondering what's next? Browse through [all of WP-CLI's commands](https://developer.wordpress.org/cli/commands/) to explore your new world. For more detailed information about creating custom commands, visit the [WP-CLI Commands Cookbook](https://make.wordpress.org/cli/handbook/guides/commands-cookbook/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities.

0 commit comments

Comments
 (0)