Somebody asked me about replacing JPG and PNG in the database with webP. You can use WP-CLI to do this using regex to find the files. Try this: wp search-replace "/(\/wp-content\/uploads\/[1-2]0[0-9][0-9]\/[0-9][0-9]\/[a-zA-Z0-9-_]*.)(png|jpg)/" "\1webp" --regex --precise --dry-run The --dry-run will just show you the results and not change the database. Remove it for the actual lice search and replace. This will find all .jpg and .png images and replace the filename with .webp. Assuming same filename as the original in .webp format in the same location on the server. Also assuming a core WP installation. You may need to tweak it for your setup, hence the dry run.