To answer your question faster, you can search our knowledgebase articles before submitting a ticket.
How to filter listings using WPL shortcode?
Posted by on 17 October 2016 02:25 AM

WPL has a flexible shortcode so you can do almost everything that you need for filtering listings using this shortcode. Let's check WPL shortcode structure.

[WPL parameter1="value1" parameter2="value2" ....]

for filtering your desired listings you can simply use parameters. For example placing sf_select_listing="9" will filter "For Sale" listings. As you can see this parameter have 3 parts, Let's see what are these parts.


All filtering parameters start with sf prefix.


It's operand of your query, you can use following operand types:

select: It uses for looking for a certain value into the listings. For example sf_select_property_type="6" will create `property_type`="6" into the query for finding the listings that have "Apartment" for their property_type column.

notselect: It acts as opposite of select. It adds `property_type`!="6" into the query for finding the listings that are not "Apartment".

multiple: If you want to look for a multiple values, you can use this operand. For example sf_multiple_listing="9,10" looks for listings that are For Sale and For Rent by creating `listing` IN (9,10) query.

text: If you want to search on a listings with a term, then you can use this operand type. for example sf_text_field_312="Johnson" generate `field_312` LIKE '%Johnson%' for finding all listings that have "Johnson" term into their title.

tmin: You can use it for numeric filters. For example if you place sf_tmin_bedrooms="2" into the shortcode, then it will add `bedrooms`>='2' to the query for finding listings that have more than 1 bedroom.

tmax: It acts like tmin but for maximum search. For example if you place sf_tmax_bedrooms="2" into the shortcode, then it will add `bedrooms`<='2' to the query for finding listings that have less than 2 bedrooms.

between: It's a combination of tmin and tmax. For example if you place sf_between_bathrooms="1:3" into the shortcode, then it will generate `bathrooms`>=1 AND `bathrooms`<=3 into the query.

datemin and datemax: They act like tmin and tmax operands but for date fields.


The third part is column name, You can find the column name in Flex menu. Just click edit button of your desired field.

Note: You can insert multiple filtering parameter into the shortcode.

Comments (2)
Brick & BLVD
07 July 2019 01:04 PM
How do we limit the amount that is displayed initially?
I've seen a "limit" parameter used before but I personally can't get it to work.
18 July 2019 12:39 PM
Hi! It would be better to get a look into your site. Please open a ticket with support so they can assist you with this issue.