Archived topic
Restrict Search to products but do not use GET method
1 reply · Started by David Bennett on March 8, 2020
I crawled my WooCommerce site with Sitebulb and it gives a warning about using the GET method to restrict search to products
I am using the code in the GeneratePress documentation restricting search to products and that uses the GET method.
I wonder what your opinion is of the warning?
And if you think there is merit in the warning, do you have alternative code using the POST method?
Thanks,
David
Hi David,
I don't think there's any real issue with using GET over POST in this instance. WordPress itself uses GET (https://github.com/WordPress/twentytwenty/blob/master/searchform.php) in all of their search forms.
Of course, you can try filtering the search to use POST, instead.