EE code causing SEO issues

I’m using SEMRush to audit my site’s SEO, and got a message that 38 pages don’t have a DOCTYPE declared. I know that my theme is a high quality theme and isn’t the case, however, when I checked the source code it shows that the Event Espresso plugin is adding code BEFORE the DOCTYPE is declared. This is bad for SEO for the following reason:

“Declaring a doctype is extremely important in order for a page’s content to load properly. If no doctype is specified, this may lead to various problems, such as messed up page content or slow page load speed, and, as a result, negatively affect user experience.”

Please let me know if there’s a way that I can move this code after the DOCTYPE, or if you can edit the plugin so that it doesn’t do this. SEO is extremely important to my client and I can’t afford for anything to negatively affect his ability to rank in the search results.

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.

Thank you for that explanation, and the for the function code, Josh. I’ve opened a ticket with Beaver Builder to try and get to the bottom of what’s going on with the theme that’s causing this to happen. Will keep you posted.