Limit the search keywords in WordPress

If you are having a nich content, there are times you wanted to only let visitor search a few specific keywords, to boost the site keyword ranking or whatever reason. In default, WordPress come with a simple search form, with an input and a button. A lot of users find it quite useless.

While searching for some solution on my project, I find some trick on limiting the keyword, but using a dropdown selection menu.

<select name="s">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>

Search select
WordPress engine use the name="s" as its listener for keyword. Now that I am using manual selection, I can bascially place only keywords I want the visitor to search for. Well, unless the visitor is a WordPress user too, as there is always possible to manully type in /?s=keyword.

One thought on “Limit the search keywords in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>