WordPress SEO By Yoast Plugin is interfering with a custom function code – how to troubleshoot and fix it? October 19, 2022 by Tarik Billa We got it working by changing the hook: add_action( 'wp_loaded', 'wp_html_compression_start' );