Support

Home Forums Event Espresso Premium EE code causing SEO issues Reply To: EE code causing SEO issues

Reply To: EE code causing SEO issues

Author Replies
Josh # Posted on April 17, 2018 at 10:54 am

Hi Fran,

The content being injected before the doctype is normally added at the start of the WordPress Loop, so something is starting the WordPress Loop too early. Event Espresso isn’t doing this, so editing Event Espresso isn’t the solution.

Here’s how to fix, you add this code to a functions plugin:

function move_ee_notices_to_main_loop() {
    add_filter('FHEE__EE_Front_Controller__display_errors', '__return_true');
    return false;
}
function remove_ee_notices_from_early_loop() {
    if(!did_action('wp_head')) {
        add_filter(
            'FHEE__EE_Front_Controller__display_errors', 
            'move_ee_notices_to_main_loop'
        );
    }
}
add_action('loop_start', 'remove_ee_notices_from_early_loop', 2);
Do NOT follow this link or you will be banned from the site!