If you change your website name, or you have to change some strings in existing imagedata of your website, we need to do the following steps:
Step 1: Fetch all attachments
Step 2: Rename all corresponding uploaded files
Step 3: update attachment data so that new files would be recognized by WP
Step 4: Update title, description data as well.
Here is a snippet which implements all 4 steps above.
Continue reading “Rename existing WordPress Attachments files, titles”