JSON is gone
-
Everything worked fine in version 1.4.4. The code <script type=”application/ld+json”> was inserted under <body>. In version 1.4.5, everything went haywire. WP 6.7.2
-
This topic was modified 8 months, 3 weeks ago by
Yevhen HTTPS.
-
This topic was modified 8 months, 3 weeks ago by
-
Hi @yevghen, thank you for choosing Head & Footer Code for your project.
I was unable to reproduce the issue site-wide and on page specific BODY.
Based on the provided screenshots, I can see two different code snippets – JobPosting in admin, but WebPage on front/validator.
Can you please check JobPosting object on front/validator (best you check ‘View page source’ with raw code)?
Thanks,
Aleksandar“WebPage” is from the Yoast plugin. It adds its markup to. My code is valid. I checked it in Rich Snippets and Schema Validator. Here is my page:
Hi there,
On that page I don’t see JobPosting in source code at all. Are you okay to share code snippet via https://pastebin.com/ and let me know what theme and plugins you have active (you can copy parts from the site info from Site Health > Info)?
Сustom theme
Advanced Custom Fields PRO
Advanced Editor Tools
All-in-One WP Migration and Backup
Выбрать Classic Editor
Classic Editor
Cyr-To-Lat
Head & Footer Code
Polylang
Polylang Slug
Redirection
Robin image optimizer
SVG Support
WebP Express
WPS Hide Login
WPS Limit Login
Yoast Duplicate Post
Yoast SEO
Disable REST APIYour code snippet worked just fine by adding it to page specific BODY section (HFC 1.4.5 and WordPress 6.8.2). Please check screenshot https://drive.google.com/file/d/12-BBAJmrM-zQIINvnVH6vo-_aV93vL4M/view?usp=sharing and here is Google Rich Results Test https://search.google.com/test/rich-results/result/r%2Fjobs?id=7GImpMf07fAXJQgdc50Ukg
You use Polylang but you have added rich snippet code only to the default language (UA). That is why JobPosting rich snippet missing on alternate (RU) page https://aris-t.com.ua/ru/taxi-kiev/robota-taksi-kiev/ while it is present on UA page https://aris-t.com.ua/taxi-kiev/robota-taksi-kiev/ – check out screenshot https://drive.google.com/file/d/14fFuOkxa-uOXv_H7hJvq5Agd3fLLh8Zk/view?usp=drive_link
Please let me know if this resolves issue for you?
Aleksandar
Okay. That’s an interesting observation. But why are snippets placed in <head> instead of <body>?
Snippets are also specified for the RU version of this page, but they are not displayed in the code. Also, there are snippets on the UA pages, and not all of them are in the page code.
-
This reply was modified 8 months, 2 weeks ago by
Yevhen HTTPS.
Maybe by mistake you put snippet to HEAD section on UA version of the site? Maybe custom theme mess wp_head/wp_body_open/wp_footer filters logic.
Btw, snippet on pastebin is for RU site while on UA site where I found snippet contains version for UA site – they differs.
Please enable
WP_DEBUGinwp-config.phpso you can see HFC injection preferences for each snippet on frontend within HTML comment, eg:<!-- Head & Footer Code: Article specific BODY section start (type: page; bahavior: append; priority: 10; do_shortcode_b: y) -->That will help to understand where snippet is in the backend.
I checked on another website. On another site that is not multilingual, everything works fine.
Hi @yevghen,
I could not reproduce the reported issue on WordPress 6.8.2 with Head & Footer Code 1.4.5, Polylang 3.7.3 and Astra 4.11.8 – code snippet added to the article specific BODY section on appropriate language page is printed on that page within the body on frontend.
Hope you can enable debugging in WordPress and check if you added code snippets to appropriate page in Polylang. Here is my demo example https://drive.google.com/file/d/1R7ZQatr0woPubVx6_0ubzPB-rAApQYsK/view?usp=sharing
Let me know if you have any further questions.
Aleksandar
What settings do you have here? https://prnt.sc/rY02wZbs-zfR
Same as you https://i.imgur.com/zn2k9yQ.png
The same. I don’t understand why it’s not working for me ((
-
This reply was modified 8 months, 2 weeks ago by
The topic ‘JSON is gone’ is closed to new replies.