Archived topic
Where to place structured data markup in generate press?
8 replies · Started by Derek on July 11, 2018
Hi,
I'm using Google's tool, and the instructions say:
"Select JSON-LD from the dropdown menu. Copy the code and paste it into the <head> or <body> tags in the HTML code of the respective page on your website."
Do I use the GP Hooks? I'm assuming no because that's global right? Is there a way to do this in GP or do I need a plugin to insert code like this into individual pages?
I ready somewhere that GP was schema ready so IDK what that means, but I certainly didn't want to break anything!
Thank you!
Hi there,
you can use GP Hooks, and wrap the code within an a Conditional tags like so:
https://docs.generatepress.com/article/using-hooks-conditional-tags/
Or wait a little while for GPP 1.7 which will make this super easy.
Thanks, it will be a while before I get to implementing this anyway. Any idea when 1.7 will be out?
The first beta has been out for awhile and a second beta is about to out as well.
You can test it out:
https://docs.generatepress.com/article/beta-testing/
More info:
https://generatepress.com/gp-premium-1-7/
Hi
I am wanting to add my structured data but can't find any documentation on how to do it or what this thread was alluding to about it being super easy....can you guide me?
Thanks
Hi there,
the plan to integrate JSON-LD into the theme was put on hold, its planned for a later update but is a significant change so needs to be done right.
You can use GP Hooks to include your Structured Data:
https://docs.generatepress.com/article/hooks-element-overview/
Or you can use a dedicated JSON-LD Structured Data plugin.
I have good experiences with this plugin https://wordpress.org/plugins/schema/
Check this site https://wpmissing.com/plugins/best-wordpress-schema-structured-data-plugins/
Thanks I did it using a hook and it was 5mins to set up and has passed googles mark up testing tool so I am all good thanks.
Glad to hear that :)