Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Search function for room rental ads WordPress

Hi Guys

I had a plug in created so that visitors could advertise rooms for rent on a website.

I am trying to get a search function/plug in written where the visitor can search for rooms by certain criteria.

The visitors need to be able to search by:

Location (where they fill in their own text, and the info is pulled from the “local area” data)

Rental Type – (a drop down box with the following options: nightly, weekly or monthly taken from the rental type data)

Then they click a button with “Search Rooms” and are presented with a list of available accommodation which I’m assuming could be taken from the “Rooms Available” page maybe.

Does anyone know of a ready made solution that would do this OR anyone up for creating it for me.

Any advice or help would be much appreciated

Many thanks

Answers (5)


Milan Petrovic answers:

I am in the process of developing plugin GD Products Center that will be used to add products by type (this can be rooms), and set up categorization/properties/specification/images/videos for each product, different product pages, search/filter capabilities and more. Currently is in Beta, with about month of development left. You can check out news about plugin and development, and request demo to test it:


Julio Potier answers:


Did you try the "Relevanssi" wordpress plugin ?


Sébastien | French WordpressDesigner answers:

This plugin could search several data (each data is in a custom field)
[[LINK href=""]][[/LINK]]

I have made an advanced search for loft (not room) here : [[LINK href=""]][[/LINK]] but it is a long work


Luis Abarca answers:

I made this sites with a similar funcionality

[[LINK href=""]][[/LINK]]

[[LINK href=""]][[/LINK]]

I'm using custom taxonomies for filter the search in both sites, and a custom table for room availability in the second one.


John Cotton answers:

<blockquote>Does anyone know of a ready made solution</blockquote>

You're almost there as it is....

You need a form in your search area (I'm guessing that's a widget?) with this kind of code in:

<form method="post" action="">

<select name="location"><!-- pull the values from your local area - don't get them typing in or else potentially you'll have missed matches for typos</select>

<select name="type"><!-- pull from your rental types (get_terms) --></select>

<input type="submit" value="Search" />

Then, on the my-ads page (template or archive.php?) you get check for $_POST value and adjust the query...

if( isset($POST(['location']) ) {

$filter = array(
'tax_query' => array(
'relation' => 'AND',
'taxonomy' => 'location',
'field' => 'slug',
'terms' => array( $_POST['location'] )
'taxonomy' => 'rental_type',
'field' => 'slug',
'terms' => array( $_POST['type'] )

// merge your new query with the existing one for this page
query_posts( array_merge( $wp_query->query, $filter ) );

And that should do it!

This, of course, assumes location and rental are taxonomies. If they are not (eg they are custom fields) just adjust the query above.