[Custom Google Search] Second copy of search results if search box in footer widget area

If you use the Custom Google Search option with the results on a separate page, you will get a second copy of the search results in the footer, if the search box is placed in a footer widget area. I could grant support access, but it's just a plain sandbox site with nothing on it. Testing will also require access to your own Google CSE dashboard. Here is the detailed testing scenario.

WordPress theme: Twenty Seventeen
All plugins disabled except WPMUDEV Custom Google Search

Place WPMUDEV Custom Google Search widget in footer widget area

Google CSE control panel
- Look and feel > Layout: Two page

WP Dashboard > Settings > Custom Google Search
- Embed Code: search box code from Google CSE control panel
- Display search results as: Custom Page
- Search Results Page: Search Results

Create a page called "Search Results"
Paste as plain text the Search Results code from Google CSE control panel

  • drew_mathers
    • Design Lord, Child of Thor

    My configuration causes two copies of the Google CSE JS to appear on the results page. According to the following article, this should be avoided, as it will cause no search results to be displayed. It will continue to display ads, but show "No Results" to the query.


    For now, I am going to change the Google CSE configuration to display the results as an overlay instead of a separate results page. This seems to work.

  • drew_mathers
    • Design Lord, Child of Thor

    The above-mentioned link talks about an interesting diagnostic technique for Google CSE search results. You can check if your site is interfering with search results by executing the search directly from the public URL. The public URL is does not live on your site, so it is free from any such interference. You can find it on the Google CSE control panel.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.