Title: Filters error when using direct URL
Last modified: April 11, 2024

---

# Filters error when using direct URL

 *  Resolved [conradude](https://wordpress.org/support/users/hellodracon/)
 * (@hellodracon)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/filters-error-when-using-direct-url/)
 * Hello Nick,
 * I’ve discovered another issue.
 * When filtering, it adds parameters in the URL, which is great but if I share 
   that URL and use it directly (or simply refresh my page with the parameters in
   the url), price filters is not working properly. For example my Price filter 
   should return 90-120 (which is the case when I filter myself and click on OK),
   but when I use the generated URL to go to the same listing with selected filters,
   it returns 14-265 (which is the default price selection when no filter is selected).
   Only workaround is to submit the filter after the page is loaded without touching
   anything and then the Price selection is ok. Can, you do something about it ?
   
   NB : _Apply Parameters From The Address Bar To Display Filter Items_  is checkedOther
   filters (categories, attribute, work fine).Kinda same weird stuff is happening
   when displaying all products in one page.I’m using pre_get_posts filter to add
   a possibility to display all the products instead of a pagination.
 *     ```wp-block-code
       function SearchFilter($query) {
           if ($query->is_search && !is_admin()) {
   
               if (isset( $_GET['showall'] ) && $_GET['showall'] == 1 ) {
                 $query->set( 'paged', 1 );
                 $query->set( 'posts_per_page', - 1 );
               } else {
                 $query->set( 'posts_per_page', 12 );
               }
   
           }
           return $query;
       }
       add_filter('pre_get_posts','SearchFilter');
       ```
   
 * It works great but the price filter goes nuts (display from 1000000000 to 1000000000
   €) and other filters don’t work properly either. Should I add something in my
   function to let the plugin know I’m displaying all the product instead of a pagination?
   
   Thanks a lot.

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

 *  Plugin Author [WBW Plugins](https://wordpress.org/support/users/woobewoo/)
 * (@woobewoo)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/filters-error-when-using-direct-url/#post-17681121)
 * Hello [@hellodracon](https://wordpress.org/support/users/hellodracon/),
 * Contact our internal support team.
   [https://woobewoo.com/contact-us/](https://woobewoo.com/contact-us/)
 * We’ll check what’s wrong.
 *  Thread Starter [conradude](https://wordpress.org/support/users/hellodracon/)
 * (@hellodracon)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/filters-error-when-using-direct-url/#post-17681959)
 * Will do, thanks !

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

The topic ‘Filters error when using direct URL’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woo-product-filter_a0a6df.svg)
 * [Product Filter for WooCommerce by WBW](https://wordpress.org/plugins/woo-product-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-product-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-product-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-product-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-product-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-product-filter/reviews/)

## Tags

 * [product filter](https://wordpress.org/support/topic-tag/product-filter/)
 * [product search](https://wordpress.org/support/topic-tag/product-search/)
 * [WordPress](https://wordpress.org/support/topic-tag/wordpress/)

 * 2 replies
 * 2 participants
 * Last reply from: [conradude](https://wordpress.org/support/users/hellodracon/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/filters-error-when-using-direct-url/#post-17681959)
 * Status: resolved