MainWP Community

Flush the ShortPixel CDN in Autoptimize

Flush the ShortPixel CDN in Autoptimize on your child site.

Snippet Type

Execute on Child Sites

Snippet

add_filter('autoptimize_html_after_minify','change_shortpixel_client', 11, 1);
function change_shortpixel_client( $HtmlIn ) {
     return str_replace( 'cdn.shortpixel.ai/client/', 'cdn.shortpixel.ai/client2/', $HtmlIn );
}
1 Like