I have spent quite a bit of time and researching the issue was very frustrating. I could finally solve the issue after many months. Let me share my experience.
Issue Description : You may be using Google Custom Search and it was working fine, all of sudden it is not working. No search results are appearing. You are wondering what is the issue. I have tried many of these things like below for many months, nothing worked.
- Go to Adsense Custom Search Engine options, change options and copy the code generated there and pasted it multiple times in wordpress pages.
- I have also created new pages, removed old pages, in wordpress and pasted the new code generated code..nothing worked.
- Also, tried changing the wordpress theme as well, no luck to make it work…
overall, I was so frustrated that I gave up on the issue and let it be like that for few months. Again today I started to research and finally found the issue…
What is the actual issue with Google Custom Search Box ? Why results are not appearing ?
Well, the reality is that Google Custom Search does not support iFrame Anymore. This is the primary reason. The funny part is that, the code that is generated in Adsense gives you the code with iFrame and there is an option to use the iFrame see below screenshots. This was the reason.
Google Custom search Does not support iFrame info on Google page.
I guess the adsense team is not aligned with the Google Custom Search team, thats the reason. I really got frustrated.
Where to Manage your Custom Search Engine ?
I guess the best place to manage Google custom Search Engine is at : https://cse.google.com/cse/all , this gives the correct code and it works ! You can tag your adsense publisher ID here as well and generate code.
Also, there are few options for search results. To make it work, where you would have google search box in one page and the results appearing in other page, you need to select the below option to work. I tried other combinations and had some issues.
Bottomline, do not use the code that is generated in the Adsense area and use the Google Custom Search options code, it will work.
What has been your experience ? Did you encounter something different ? How did you solve it ?