E
E
error4012020-03-02 15:16:20
Search Engine Optimization
error401, 2020-03-02 15:16:20

How to add JSON-LD only for the main page of a Wordpress site?

Hello.

There is a site on VP. Seoshnik asks to add json-ld schema for the main page of the site (the markup code was provided to me).
As far as I know, the markup is placed in the head of the page.

The site uses one header for all pages. That is, if I add the json-ld code to the head, then this markup will be distributed to all pages, which is wrong.

Tell me how to add markup code so that it works only for the main page of the site? I see such an option - to create an additional header that will be used only for the main page and add the json-ld markup code to this header. On all other pages, connect the standard header. I don't know if it's the right thing to do or not.

Do not offer plugins.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-03-02
@error401

https://wp-kama.ru/hook/wp_head
https://wp-kama.ru/function/is_front_page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question