Database – SQL query to rewrite all media URLs ending with .webp

I have manually converted all the media files to .webp within the ‘Uploads’ folder, I have maintained the folder structure, each .webp image resides in the same folder as its predecessor. How do I convert all media links to end with .webp so that they now point to converted images?

See example below:

From this

To this

I’ve tried to find a SQL query that I can run to rewrite all media links in the database without success.

Leave a Comment