Loading...

Knowledge Base
 Up to 75% off  on  WordPress  hosting for WordPress Websites and Stores!

Find and Replace Across Multiple Files

With SSH command line access, you can do the following to edit several individual pages to replace a string of text, e.g. update the phone number on the footer of every page on your site.

  * perl -pi -w -e 's/search/replace/g;' *.php
    -e means execute the following line of code.
    -i means edit in-place
    -w write warnings
    -p loop
  * find ./ -type f -exec sed 's/search/replace' {} \;
Did you find this article helpful?

 
* Your feedback is too short

Loading...