[Solved]: Schema data in page HTML header not showing up in google / schema checker

Hi all,

I have a hard time tracing a weird bug.

I’ve added schema data to my page HTML header.
It shows up fine in the page source.
The code itself is validated correctly using https://validator.schema.org/

The weird thing: if I try to validate the url itself, the whole script that is in my page html header doesn’t show up, neither does it in google’s tools…

Can’t figure out why for the life of me :sweat_smile:
Anyone ran into the same issue or has a pointer?
Help would be much appreciated!

Example page: Expres-Zo: Workshop glas of aardewerk schilderen | aatly.nl/Utrecht

My schema code as shown in page source:

Screenshot of page HTML header setup:

For that someone running into something like this in the future…

I found the issue. Not related to schema.

There was a ‘bug’ in the <link> tag above. I closed that with />. Apparently either bubble or google does NOT like that. When I removed it all was fixed.

It’s weird, because although not mandatory, it is allowed in html5 spec…
Ah well.

You don’t need the link at the top…all that is needed is this

<script type="application/ld+json">

For anybody else who find this thread as it is solved, below is a screen shot of the top portion to show the correct setup for Schema data

Screen Shot 2023-03-20 at 6.01.27 PM

Yeah the canonical wasn’t related to the schema code. It was already there (need it because the build in canonical wasn’t working well for me).

But yes, for anyone else just focussing on the schema data. No need to include the <link> :slight_smile:

That is interesting…I am in need of becoming more familiar with canonical URL and thought the built in was mostly just for the index page, but I need it for my listings page.

Is the method you used in the header all that is needed to setup the canonical for a specific page, so that if for instance I had a page for event listing and another for job listing, I could create the canonicals for them on their respective pages?

Yeah! Works like that.
I use the ‘get path from page url’ on top of the base url to make sure there are no url parameters in it. Which is the exact thing you want to avoid (otherwise you have lots of duplicate pages with slightly differing urls.

You could also do this using ‘this url’ and then split on ‘?’ I would think. But haven’t tried it.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.