Hi Packjallo!
Thanks for reaching out! Kindly share some code snippets of how you have implemented a “rewrite” on Cloudinary image URL output and the hooks that you have employed in doing so. This will give us further insights and may help you find a solution.
Regards,
Anthony
Hi Anthony,
We’re getting the Cloudinary image URL using wp_get_attachment_metadata(), splitting the URL, and adding our own transforms in this way. This is a custom function that we use inside our theme.
Doing this unfortunately means that our URL gets rewritten as part of the plugin. For now we have disabled this using the following, but I don’t know how sustainable it is to keep this in our functions file.
function remove_cloudinary_actions() {
remove_all_actions( 'cloudinary_string_replace' );
};
add_action('init', 'remove_cloudinary_actions', 999);
Is there another option available to do this? Ideally more of a first-party solution?
Many thanks,
Jack.
Hi @packjallo,
Would you mind opening a ticket to [email protected] and sharing a system report as explained [here](https://support.cloudinary.com/hc/en-us/articles/360022260599-How-to-generate-a-system-report-on-the-WordPress-plugin-)? If you can also add some assets (cf 2nd video) that would also be helpful.
Thanks in advance.
Best,
Loic
Just to piggyback off of this: we have the plugin option ‘Optimize images on my site.’ set to false (off) but the plugin still transforms my image URLs:
For example, in my page I have an image:
<img src="https://res.cloudinary.com/sallysapizza/images/v1669074237/dev/michael-discenza-MxfcoxycH_Y-unsplash/michael-discenza-MxfcoxycH_Y-unsplash.jpg?_i=AA">
And this gets turned into:
<img width="2054" height="2131" decoding="async" src="https://res.cloudinary.com/sallysapizza/images/w_2054,h_2131/v1669074237/dev/michael-discenza-MxfcoxycH_Y-unsplash/michael-discenza-MxfcoxycH_Y-unsplash.jpg?_i=AA" class="wp-image-99" data-public-id="dev/michael-discenza-MxfcoxycH_Y-unsplash.jpg" data-format="jpg" data-transformations="" data-version="1669074237">
This is even worse with SVGs where it changes the file extension to png – completely negating the benefits of SVG.
As with @packjallo we use custom functions to transform our image/video URLs to our liking, and this hijacking of the output is frustrating to have to hack around.
I opened up a support ticket https://support.cloudinary.com/hc/requests/207924 and added a report, but was hoping you could shed some light on it in this thread so others may benefit.