@dschitra Good question, it may be something more appropriate for the GitHub repository, the same query was asked previously. You may need to use the amp-script component or an amp-frame solution.
Are you looking to keep the search results within your own site as opposed to directing users to an offsite search page?
i want to redirect to google self search result page.
@dschitra Can you try the below:
<form method="GET" action="https://www.google.com/cse" target="_top">
<div class="amp-customsearch">
<input name="cx" type="hidden" value="partner-pub-4363922843610542:5346169524" />
<input name="ie" type="hidden" value="UTF-8" />
<input type="search" placeholder="Search..." name="q" required>
<input type="submit" value="Go" class="search-links">
</div>
</form
Let me know if that works for you, alternatively can you try the suggestion here.
where i put my google cse id?
@dschitra I’ve provided it in that code snippet. Let me know if that works for you after adding to a custom HTML block.
it is working but it shows non-amp urls in search queries
thanks for helping me….
One thing more can i use this code for amp and non-amp both pages as well?
@dschitra
it is working but it shows non-amp urls in search queries
That’s down to how search engines determine the most suitable links I suspect. Did you check from mobile? You can ask the product experts using the Search Console Help Center.
One thing more can i use this code for amp and non-amp both pages as well?
Yes, you can use in both AMP and non AMP.
thanks for helping me….
No problem, feel free to leave the plugin a review.
It’s safe for Google Adsense Policy?