Skip to content

Instantly share code, notes, and snippets.

@nash-ye
Last active July 18, 2023 12:12
Show Gist options
  • Save nash-ye/6754f569c46be2c58455eeb1d79e7a8e to your computer and use it in GitHub Desktop.
Save nash-ye/6754f569c46be2c58455eeb1d79e7a8e to your computer and use it in GitHub Desktop.
A Linux command to loop through CSV file records and do WP search-replace.
while IFS=, read orig new; do wp --skip-themes --skip-plugins search-replace "$orig" "$new" wp_posts --include-columns=post_content --verbose; done < example.csv
@rvwoezik
Copy link

Hi, do you have an example of the csv file?

@l-guillaume
Copy link

Hi, same as @rvwoezik do you have an example of the csv file? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment