TinyMCE image reference not converted to webp

2 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 8:46pm   (RSS)

By kitsguru - Yesterday at 1:49pm - edited: Yesterday at 2:29pm

I recently converted my images to WebP and ran the convert all images to webp from the general section. Any images in the upload files are fine. The issue is with the TinyMCE images that I use. They still reference the old format, so they are broken in the front-end display.

I was going through each record and manually changing the extension, but that is painfully slow.

I use MariaDB 10.6, so I was able to use this SQL statement:

// adjust the table and column names as appropriate
UPDATE ::mytable
SET content = REGEXP_REPLACE(
  content,
  '(?i)\\.(jpe?g|png)',
  '.webp'
)
WHERE content REGEXP '(?i)\\.(jpe?g|png)';
Jeff Shields
yaadev.com