- This topic has 11 replies, 4 voices, and was last updated 2 years, 9 months ago by
Fernando.
-
AuthorPosts
-
December 21, 2022 at 7:24 pm #2470030
Jodie
Hi,
What’s the best way to add different kinds of schema (like Organization, Author, Article & Rating) to my website pages?
Thanks for your help!
Cheers Jodie
December 21, 2022 at 7:49 pm #2470043Fernando Customer Support
Hi Jodie,
You can try using a plugin for this.
Most of our users use either WP Schema Pro, RankMath, or Yoast. You can try each and see what works best for you.
Reminder: If you’re adding your own schema from any of these plugins, you may have to remove the basic schema GP adds. Here’s how to remove it – https://docs.generatepress.com/article/generate_schema_type/
December 21, 2022 at 9:03 pm #2470067Jodie
Hi Fernando,
Is using a plugin the only way to do this? Can I do it via a php function?
Thanks for your help!
Cheers Jodie
December 22, 2022 at 2:13 am #2470209David
StaffCustomer SupportHi there,
there are sites that generate schema for you – like this one:
https://technicalseo.com/tools/schema-markup-generator/
Which can be added to a site using a Hook, set to the
wp_head
hook.
So for Organization schema where i assume the data would be static you could simply copy / paste.For the Article schema where that data and possibly the JSON Structure will differ for each post there are 2 main options:
1. Manually generate schema for each post, store it in the posts meta using a custom field, and output that field using a hook.
2. Create PHP template parts that provide the necessary schema structure that is populated with dynamic data, some of which may require Custom Fields to be added to your post, hook the PHP template into the site.Both of those methods require custom development, which is out of our scope. And to be honest I would not want the pain of maintaining either system when good plugins are available.
December 22, 2022 at 3:06 am #2470251Jodie
Hi David,
Great, thank you so much for your help! I’ll keep investigating.
Cheers Jodie
December 22, 2022 at 3:15 am #2470260David
StaffCustomer SupportYou’re welcome
December 23, 2022 at 7:12 pm #2472027Jodie
Hi David,
The plugin I use (SEOPress) doesn’t have an ability to put “author schema” on an author archive page.
Is there any way to do this with a PHP function?
Thanks for your help!
Cheers Jodie
December 24, 2022 at 5:26 am #2472259David
StaffCustomer SupportWhat schema would you add there ? A
Person
JSON-LD maybe ?
And if so how many authors on the site ?December 25, 2022 at 12:53 pm #2473123Maki
Greetings everyone!
I’m also working on implementing schema to my website https://makikulinarka.com/
It’s a cooking/recipes website, so I want my articles to appear in the search; as you know, those blocks contain reviews and time and whatever. So I want to ask you about the manual implementation methodology. As much as I understand, I have to create my own schema. I already did create a JSON schema via using schema.com. So when it comes to implementing it directly to my post, can I copy that schema and paste it into the HTML block inside of my post? I believe that it won’t appear on the front end, but it will appear on the back-end and view page source.I would be grateful if you could confirm if I am right or wrong 🙂
December 26, 2022 at 4:07 am #2473531David
StaffCustomer SupportHi there,
yes you can copy and paste the schema script straight into a HTML Block. It won’t show up on the front end but search engines will see it.
January 3, 2023 at 6:13 pm #2482892Jodie
Hi David,
Yes, a “person” schema. And there’s only one author on the site.
Cheers Jodie
January 3, 2023 at 6:45 pm #2482904Fernando Customer Support
Hi Jodie,
If that’s the case, you can use https://technicalseo.com/tools/schema-markup-generator/ as mentioned by David.
Set the schema.org markup as
Person
.Fill in the data, and copy the code generated to a Hook Element. Reference: https://docs.generatepress.com/article/hooks-element-overview/
Hook it to
wp_head
.Set the display rule location to your preference.
-
AuthorPosts
- You must be logged in to reply to this topic.