add_filter to the_content after apply_filters
if you want to keep the current setup, try to hook in early and use do_shortcode(): function av_standalone_doc_404($content) { remove_filter( current_filter(), __FUNCTION__ ); if ( has_term( ‘standalone-document’, ‘formats’ ) ) { $filtered_content = do_shortcode( $content ); // … If you want to avoid repeating shortcode outputs use a static variable in the shortcode handler: function … Read more