Title: Filter content, not posts/comments by Query String
Last modified: August 21, 2016

---

# Filter content, not posts/comments by Query String

 *  [downsy42](https://wordpress.org/support/users/downsy42/)
 * (@downsy42)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/filter-content-not-postscomments-by-query-string/)
 * Hi
    I have a site where I am passing a postcode/zipcode by query string to a 
   new page. I want to filter the content on this page (not filter conmments or 
   posts). For example each zip code will have an attached consultant. So I want
   the page to display the details of the relative person to contact when their 
   zipcode /postcode is carried across. All the consultants and their details are
   in a table called tblConsultants in the database. Am I querying on the page or
   back in the database. Everything seems to be based on the post style backbone
   I need it to work as a CMS. Thanks in advance. Cheers Peter

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Paul Kaiser](https://wordpress.org/support/users/freakingid/)
 * (@freakingid)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/filter-content-not-postscomments-by-query-string/#post-4024926)
 * My first thought is to create a Taxonomy for the zip code, and assign consultants
   to the correct taxonomies. Then WordPress can easily do the filtering for you.
 * It sounds like that might mean you have to get their zipcodes out of the database
   and assign to correct taxos, though.
 * Is tblConsultants a WordPress table, or table from some other system?
 * Paul
 *  Thread Starter [downsy42](https://wordpress.org/support/users/downsy42/)
 * (@downsy42)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/filter-content-not-postscomments-by-query-string/#post-4025017)
 * Hi Paul,
    thanks for getting back to me. Yes I have set up a table in the wordpress
   database tbl_consultants. This table contains fields: consultantID, name, address
   etc Users enter a zipcode on the home page and it is redirected to the consultant
   page passing a query string. For eg: ?zipcode=2001 Each consultant has their 
   details and is assigned to a range of zip codes which are located in a 2nd table
   called tbl_consultant_areas. It has fields : consultantID, areaID and zipcode.
   So I need to filter the details showing up on the page by the zipcode passed 
   to it. Thanks Peter

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter content, not posts/comments by Query String’ is closed to new 
replies.

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [query strings](https://wordpress.org/support/topic-tag/query-strings/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [downsy42](https://wordpress.org/support/users/downsy42/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/filter-content-not-postscomments-by-query-string/#post-4025017)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
