Site logo

Archived topic

sameAs Schema

8 replies · Started by Jacob on June 13, 2020

Viewing posts 1–9 of 9

Hi guys! You are always so helpful, have a bit of a technical question.

I'm having a bit of difficultly editing the sameAs schema. https://schema.org/sameAs - basically I can't edit the schema markup at all.

I'm not clear if Yoast or if your theme already has some kind of schema implemented.

Long story short, I want to edit the JSON array to include this type of markup, but I'm not too clear how to edit it. I'm pretty ok with Javascript if you can point me with the right direction, I just get confused with PHP.

Do you have any suggestions on how I should edit it, code myself or a plugin?

Thanks!

Hi there,

GP adds very basic structured data to your HTML, which you can disable:

add_filter( 'generate_schema_type', '__return_false' );

As for JSON-LD, it looks like you're using Yoast for that. I'm not sure if they allow for customization to the data, but I assume they do.

Perhaps this will help?: https://developer.yoast.com/features/schema/api/#social-profiles

Great thanks! I read more about it, it seems the most easy thing to do would be to just add the JSON-LD script to the <head> via one of your hook elements. I only wanna add it to the homepage. Correct me if I'm wrong, but that should simply things quite a bit.

1) If I leave your schema & Yoast on the site, will it create a conflict?

2) Where do I add the PHP function you suggested? PHP was never my thing lol.

Thanks again.

Thanks guys!

Hey guys, Sorry I have one more question.

I gave up on plugins, I know JSON so i coded it myself. I created a generate press hook to insert my JSON into the <HEAD>.

However I now have:

'
<script type="application/ld+json" class="yoast-schema-graph">
<script type="application/ld+json">
'

As you can see the Yoast script is set to a higher priority.

By any chance can you suggest a way to disable the Yoast script ONLY for the homepage?

great thanks! I found a different solution. The plugin you recommenced for php snippets allows you to select only the home page and I added this filter:

add_filter( 'wpseo_json_ld_output', '__return_false' );

Sorry about that, I'm terrible with PHP.

Thanks again!

Glad to hear that

This archived topic is closed to new replies.