Posted: April 17, 2018 at 10:40 am
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. screenshot: https://www.screencast.com/t/JcSvXiG9Z4D I can send you a link to all of the pages on my site with this problem, if you’d like. Thank you. |
|
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:
|
|
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. |
|
They may have a reason for starting the loop early, in any case the above code will ensure the markup gets injected onto the page at the correct location. |
|
Hey Josh, When you add a posts module to a page it also uses a wp query to fetch those posts, i dont know how anything would be doing a loop early. So I just added the code you gave me and everything is fine now. Thanks for the help! |
|
The support post ‘EE code causing SEO issues’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.