HTML srcset option breaks Google Site Search
-
I noticed the Google-powered Site Search (https://www.google.com/cse/) my site uses wasn’t being shown. I looked at the page’s source, and it appears the <gcse:search> and </gcse:search> required by Google was being turned into <search> and </search> server-side… thus breaking the site’s Google-powered search.
Some poking around showed that this was entirely caused by the HTML srcset option of this plugin. Turns out this option uses DOMDocument’s saveHTML() function (rather than HTML rewrite returning a str_replace modified $buffer), and it’s likely the cause of the required “gcse:” part of the Google search tags being stripped from the page.
I’m looking for a fix to this, but I’m guessing it might mean this part of the plugin uses something like https://simplehtmldom.sourceforge.net to accomplish this (hopefully this doesn’t share the same issue), or uses the same method as the HTML rewrite option.
Thanks in advance for anything you find & hoping for a fix!
- The topic ‘HTML srcset option breaks Google Site Search’ is closed to new replies.