How can I fix invalid HTML elements in the head section of my pages?

I have 123 pages the have invalid HTML elements I dont even know where to start or how to fix these can any provide insight on how to fix this is there a program that will fix all 123 errors at once.

here is an example of one of the pages

https://welaxy.com/collections/gifts-over-100

I’m using w3 validator however i could not tell you one thing this is trying to tell me.

https://validator.w3.org/nu/?doc=https%3A%2F%2Fwelaxy.com%2Fcollections%2Fgifts-over-100

The problem validator complains about is caused by the Opinew App Block.

The app outputs a

inside which is not allowed inside by HTML standards.

Browsers are (usually) ok with this – they simply move these flow content tags (those which should be displayed on page) to the top of the , so it’s not a problem for your visitors, but it’s still invalid HTML.

However, when validator encounters a

it assumes that is closed and opened implicitly – that’s why it complains about “Stray end tag head” and “Start tag body seen but an element of the same type was already open.” when it later encounters and tags.

Your options:

  • ignore this error
  • talk to App support
  • see if there is another way to integrate the App in your theme.

See the highlighted line in the screenshot:

1 Like

Does this cause a problem for googlebot? there is no way for me to fix these errors only the app developer can?

What program are you using to see this?

Dev tools “Inspect” would not show you this – it will show HTML after parsing and fixing and offending div will be shown already in body.

However, when you right-click and “View Page source” it will show you HTML exactly as received from the server – that’s where you can see the problem.

I do not think it will be a problem for google bot – if Chrome can auto-fix it without, then the crawler should be able to do it too.

As for fixing – I do not know, may be there is another way to integrate the App in your theme and you can use it.

I’d complain to app devs anyway and see what they can tell.

1 Like

Sorry I’m a little confused but this is so helpful. for example https://welaxy.com/products/drawer-organizer-7-piece what is the error on this page and how do i identify it? when i look at the view page source I only see 1 time however when i view source code i see 3 times but i dont see what the error is

Somehow, I see only one

There is a big difference between head, header and header-section.

Since these pages use the same layout, the “

in ” error would be the same.

1 Like

Re: screenshot –

  1. You’re looking at “elements” view, not “View Page Source”

  2. Second in your screenshot is inside iframe – you would not see it in “View Page Source”.

Iframe is like a window (or sub-browser) which shows content from another website. Validator would never see it.

1 Like

I have the same issue, were you able to solve it? if so how did you do it?