ACF Shortcode bringing in my shortcode is adding unnecessary line breaks

It was solved by a coworker. function removebreaks($content) { $content = str_replace(‘<br>’, ”, $content); $content = str_replace(‘<br/>’, ”, $content); $content = str_replace(‘<br />’, ”, $content); $content = str_replace(‘<BR>’, ”, $content); $content = str_replace(‘<BR/>’, ”, $content); $content = str_replace(‘<BR />’, ”, $content); return $content; } add_filter(‘acf_the_content’, ‘removebreaks’);

Keep br tags from stripping

Since any attribute added to <br> tag, including class names and data-attrs keeps them from stripping, quick and incomplete way could be: function filter_function_name( $content, $post_id ) { $content = str_replace(‘<br>’, ‘<br data-x>’, $content); $content = str_replace(‘<br >’, ‘<br data-x>’, $content); $content = str_replace(‘<br />’, ‘<br data-x>’, $content); $content = str_replace(‘<br/>’, ‘<br data-x>’, $content); return … Read more

wpautop filter off for pages but on for posts

You could try this in your functions.php file function disable_wpautop_for_pages(){ if ( is_page()){ remove_filter( ‘the_content’, ‘wpautop’ ); } } add_action(‘init’, ‘disable_wpautop_for_pages’); I have not tried this. It’s just a guess