Title: Wrong filter count with Ajax loading
Last modified: September 20, 2022

---

# Wrong filter count with Ajax loading

 *  [heijtec2](https://wordpress.org/support/users/heijtec2/)
 * (@heijtec2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/)
 * We are experiencing problems with ajax loading.
    When the filters are used with
   Ajax loading the hiding of terms is not working. Example: filter A is selected
   and filter B is showing term 1 and 2, but only term 2 should be showing. When
   Ajax loading is turned off the problem is gone and terms are showing correctly.
   On mobile version nothing is working, because Ajax is always on when using the
   filters on mobile. So people are selecting all filters and then no product is
   available because the Ajax function is not working. The theme we are using is
   Avada. Optimalisation plugins are deactivated.
 * Can someone help us with this problem? Thanks in advance.

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

 *  [Iván Sosa](https://wordpress.org/support/users/ivansosa/)
 * (@ivansosa)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/#post-16034502)
 * Hi there,
 * hope you are doing well! 🙂
 * In order to check what is happneing, please, could you send the URL of your site?
   
   We will try to investigate what is causing the conflict or problem.
 * Have a nice day!
 *  Thread Starter [heijtec2](https://wordpress.org/support/users/heijtec2/)
 * (@heijtec2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/#post-16034584)
 * Hi there,
 * I am doing great thanks!
 * The link to the test page is: [https://cilinderkoppen.com/shop-test/](https://cilinderkoppen.com/shop-test/)
   
   Try selecting “Gebruikte Cilinderkop” and then “Daihatsu”. As you can see there
   are no products but the filter “Daihatsu” is still visible.
 * Turning off Ajax solves the problem but is not the most beautiful option ofcourse.
   
   Optimalisation plugins are disabled.
 * Thanks for looking into it and I hope to hear you soon.
 * Greetings
 *  [Iván Sosa](https://wordpress.org/support/users/ivansosa/)
 * (@ivansosa)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/#post-16037970)
 * Hi there,
 * hope you are doing well! 🙂
 * Please, try to add this custom code in the functions.php of your theme:
 *     ```
       if( ! function_exists( 'yith_wcan_content_selector' ) ){
       	function yith_wcan_content_selector( $selector ){
       		$selector = '#main ';
       		return $selector;
       	}
       	add_filter( 'yith_wcan_content_selector', 'yith_wcan_content_selector' );
       }
       ```
   
 * Let us know if that did the trick, please.
 * Have a nice day!
 *  Thread Starter [heijtec2](https://wordpress.org/support/users/heijtec2/)
 * (@heijtec2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/#post-16046459)
 * Thanks a lot for the quick and easy fix!
    The filters are loading as it should
   now.

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

The topic ‘Wrong filter count with Ajax loading’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-ajax-navigation/assets/icon-256x256.gif?
   rev=3129944)
 * [YITH WooCommerce Ajax Product Filter](https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [heijtec2](https://wordpress.org/support/users/heijtec2/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/wrong-filter-count-with-ajax-loading/#post-16046459)
 * Status: not resolved