Overview
By default, Listing ID and Address search pages may only search active listings.
This customization allows both the Listing ID and Address search pages to search across:
- Active listings
- Sold listings
This is done by adding a hidden status category field to the IDX search form.
Setup Instructions
Step 1: Navigate to Subheaders
In the IDX Broker account, go to:
Design → Website → Sub-Headers
Step 2: Select the Correct Pages
Add this script to the applicable subheader area, such as:
- Pages → Listing ID
- Pages → Address
- Or a shared/global subheader if appropriate
Step 3: Add the Script
Turn WYSIWYG off, then add:
<script type="text/javascript">
/*
Allow IDX Broker Address and Listing ID search pages
to search through both active and sold categories.
*/
idx(function() {
// Run only on Listing ID and Address search pages
if (idx('#IDX-main').hasClass('IDX-page-listingid') || idx('#IDX-main').hasClass('IDX-page-address')) {
// Append status category field with both active and sold selected
idx('#IDX-searchForm').append(
'<select id="IDX-statusCategory" name="a_statusCategory[]" style="display:none;" multiple>' +
'<option selected value="active">active</option>' +
'<option selected value="sold">sold</option>' +
'</select>'
);
}
});
</script>How It Works
The script checks whether the current page is either:
- Listing ID Search
- Address Search
If it is, the script appends a hidden multiple-select field to the IDX search form with both active and sold selected.
Important Notes
- Sold listing availability depends on MLS rules and account permissions
- Not all MLSs allow sold data display/search
- This customization does not grant sold data access if the account/feed does not already include it
- WYSIWYG should be disabled when adding the script
Troubleshooting
Sold listings not appearing
- Confirm the client’s MLS/feed includes sold data
- Verify sold listings are allowed for display/search
- Confirm the script is placed on the correct page/subheader
Script not working
- Make sure WYSIWYG is turned off
- Check the browser console for JavaScript errors
- Confirm the search form ID exists:
#IDX-searchForm
Only active listings are returned
- Inspect the submitted form data and confirm
a_statusCategory[]includes both:activesold
Best Practices
- Test with a known sold Listing ID or address
- Verify MLS compliance before enabling sold search behavior
- Use page-specific subheaders when possible to avoid unnecessary scripts on unrelated pages
🤖 Zendesk AI / Answer Bot Intents
Intent: Search sold listings by Listing ID
User might ask:
- “Can Listing ID search find sold listings?”
- “Why won’t my sold listing ID show up?”
Answer:
Yes, if the MLS/feed includes sold data. A hidden status category field can be added to the Listing ID search form so it searches both active and sold listings.
Intent: Address search sold listings
User might ask:
- “Can Address Search return sold listings?”
Answer:
Yes, Address Search can be customized to include sold listings by adding a hidden status category field that includes both active and sold listing statuses.
Intent: Sold listings not showing
User might ask:
- “Why aren’t sold listings showing in search?”
Answer:
Sold listings will only appear if the MLS allows sold data and the client’s IDX feed includes it. The customization does not add sold data access; it only includes sold listings in the search request.