admin管理员组

文章数量:1122846

I have problem with search in WordPress. I want to remove the "s" parameter in the URL. This is my URL:

www.example?post_type=tour&s=&tour_location=70&tour_types=116&tour_month=144&tour_year=66

I want the URL to look like:

www.example?post_type=tour&tour_location=70&tour_types=116&tour_month=144&tour_year=66

How do I need to modify my code?

I have problem with search in WordPress. I want to remove the "s" parameter in the URL. This is my URL:

www.example.com?post_type=tour&s=&tour_location=70&tour_types=116&tour_month=144&tour_year=66

I want the URL to look like:

www.example.com?post_type=tour&tour_location=70&tour_types=116&tour_month=144&tour_year=66

How do I need to modify my code?

Share Improve this question edited Jan 23, 2017 at 10:46 fergbrain 4502 silver badges7 bronze badges asked Jan 23, 2017 at 8:56 johan riyantojohan riyanto 1
Add a comment  | 

1 Answer 1

Reset to default 0

The "s" variable parameter is for the search term and is used when there's a search on a WordPress site.

If you have a form that users are filling out, there should be code similar to:

<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />

Delete that input tag and the "s" will disappear.

本文标签: pluginsRemove Url Parameter Wordpress