The Problem & Solution
We have to change brandname from BurnAlong to Burnalong but there are image file name was uploaded while migration process. Client focus on SEO meta
Solution:
Use MyKinstar tool replace text it will replace all content in the database, SEO meta description include image file name.
After the WordPress search and replace is complete, you need to change all image name to a new one.
Take a backup first, it is super easy, this way if you mess anything up you can re-import and start over.
2# Search and Replace Tool in MyKinsta
Tips
For custom site configurations, or in the case of a plugin or theme error, the search and replace tool may not be able to complete. For these situations, we recommend trying the WP-CLI search-replace command with the –skip-plugins and/or –skip-themes flags as needed.
3# Remote login to SSH at Kinsta to change all images name
1. Open a Terminal or iTrem on macOS or Linux
2. Connect to the server via the command line
Basic SSH Commands
- ls - Use the ls command to get a list of the files and directories in your current location.
- cd - Use the cd command to change directories. You’ll be taken to the new directory and the command line will indicate where you are
- mv - As an alternative to copying a file, you can move it using the mv command. For this, you just provide the source and destination in excel
ls
cd public
ls
cd wp-content/uploads
ls
find . -name "*Yourtext*"
You’ll see a screen that looks something like this:
Find & Replace media file name in excel
- The mv Command
- Find (source)
- Replace (destination)
Copy all text and paste in Terminal hit Enter
mv ./2022/04/BurnAlong-ExerciseDeviceImage-3-1-1024x674.jpg ./2022/04/Burnalong-ExerciseDeviceImage-3-1-1024x674.jpg
mv ./2022/04/BurnAlong-ExerciseDeviceImage-3-1.jpg ./2022/04/Burnalong-ExerciseDeviceImage-3-1.jpg
mv ./2022/04/BurnAlong-ExerciseDeviceImage-2-768x506.jpg ./2022/04/Burnalong-ExerciseDeviceImage-2-768x506.jpg
mv ./2022/04/BurnAlong-ExerciseDeviceImage-1024x674.jpg ./2022/04/Burnalong-ExerciseDeviceImage-1024x674.jpg
mv ./2022/04/Mockup-BurnAlong-Classes-Categories-WellnessHabits-opt-2-300x200.png ./2022/04/Mockup-Burnalong-Classes-Categories-WellnessHabits-opt-2-300x200.png