Here is brief technical guide for the coding part for Google Search in Sitelinks on WordPress using JSON-LD in real complicated custom search. WordPress SEO has this feature, but actually our intention is to show you the complicated tweaks needed for practical situations – like in case of using Google AdSense Search instead of the default WordPress Search. This Google Search in Sitelinks, WordPress and JSON-LD is a new topic, which is updated on late September 2014. We are not talking about the plain Sitelinks or Searchbox on Sitelinks. The feature was present before, but JSON-LD thing is newer. This is intent ended for the advanced users. You will receive an email from Google Webmaster Tool if your website is eligible. You need not to do more than the coding part. In fact, without using JSON-LD, Google Search in Sitelinks appears in statistically significantly significant brands.
Google Search in Sitelinks, WordPress and JSON-LD : Introduction
We have to agree with Joost’s opinion – actually these has no practical impact on conversion rate. It is fully a decorative material for users’ experience. Do not waste a huge time behind it. What WordPress SEO by default adds is for the search url like https://thecustomizewindows.com/?s=
– this is the default WordPress search results. If you have this stuff, possibly you’ll get the Sitelinks properly from categories. If for some reason Google went confused, it probably makes the head to function properly
. So, 99% will never need any modification irrespective of the fact – whether default WordPress Search is offered on the website or not. But add a PHP function on your Theme or Child Theme’s function.php
file :
1 | http://php.net/manual/en/function.pspell-suggest.php |
It is PHP’s version of Google’s ‘Did you mean:’ like thing. Otherwise, * , ^
etc. or typo might appear on site links!
Here goes the official documentation :
---
1 2 | https://developers.google.com/webmasters/richsnippets/sitelinkssearch # Sitelinks Search Box |
Do not use schema.org
markup as Microdata (itemscope item type stuffs) for this purpose. It has technical problem in implementation and you can test on rich snippet testing tool – it can add bias. It is an example with Darren Rowse’s DPS :
We gave this example, because it is a WordPress blog; not really a bigger multi billion, multi national brand like VMWare or IBM. But this is a significant blog.
Google Search in Sitelinks, WordPress and JSON-LD : Coding Part
Usually our Google AdSense Search URL looks like this :
1 | https://www.google.com/cse?cx=partner-pub-ABCDEFGH:1234567890&ie=UTF-8&q= |
If you perform a search with Cloud IaaS
(example) on our website, you’ll land on Google’s webpage with our logo and get the results. We are talking about that URL. We have used a separate page outside our domain (it is of Google, the search result page; it could be of our subdomain – i.e. a different parameter than the home page URL). If you Edit this snippet properly, you’ll get the right JSON-LD on home page (use WordPress Filter to only echo this on Homepage). We have the gist here on Github. You can easily get the RAW file from SSH screen. Definitely, you can use static parts instead of PHP functions. You can check our homepage’s HTML source code to understand the thing. google.com
has no such stuffs, by the way.