Google Sitelink Search Box Code Issue on YOAST
-
I want the Google Sitelink Search box to work. Here is what I’m talking about for people who are not familiar.
https://developers.google.com/webmasters/structured-data/slsb-overview
So I’m using WooCommerce along with WordPress, and currently the YOAST plugin auto adds the necessary code for Google Sitelink Search box to work. Below is the code on my site auto added by YOAST. But it’s not working for me.
<script type=”application/ld+json”>
{
“@context”: “https://schema.org”,
“@type”: “WebSite”,
“url”: “https://www.mysite.com/”,
“potentialAction”: {
“@type”: “SearchAction”,
“target”: “https://www.mysite.com/?s={search_term}”,
“query-input”: “required name=search_term”
}
}
</script>When I search my Woo site the “target”: URL YOAST auto adds is correct but after the > “https://www.mysite.com/?s={search_term}”, I also have https://www.mysite.com/?s={search_term}&post_type=product.
I think this might be the issue since it’s a WooCommerce store and the current Target URL is for a WordPress blog search.
Anyone here who can help me out with this? Would greatly appreciate.
Thank you!
- The topic ‘Google Sitelink Search Box Code Issue on YOAST’ is closed to new replies.