Back to Community

Understanding and Reducing YITH WooCommerce Wishlist AJAX Calls

11 threads Sep 16, 2025 PluginYith woocommerce wishlist

Content

Many WordPress site owners using the YITH WooCommerce Wishlist plugin report performance issues related to excessive admin-ajax.php calls. These calls can lead to high server CPU usage, slower page load times, and even site instability. This guide explains why these AJAX calls happen and provides practical solutions to reduce them.

Why Does YITH Wishlist Make So Many AJAX Calls?

The plugin uses AJAX for several core functions, which can trigger calls even when the 'Enable AJAX loading' setting is turned off. Based on community reports, the primary reasons are:

  • Cache Prevention: AJAX is used to refresh wishlist templates and buttons to prevent caching systems from serving outdated content. This is a common issue with hosts like WPEngine.
  • Variable Product Handling: On single product pages for variable products (e.g., products with different sizes or colors), the plugin frequently checks for variations to ensure the correct item is added to the wishlist.
  • Shortcode Usage: Placing a wishlist shortcode on a page, especially a single product page, can significantly increase the number of AJAX requests on each page load.
  • Nonce Verification: For logged-in users, the plugin uses WordPress nonces for security. If your caching system serves pages to logged-in users, these nonces can become invalid, triggering additional AJAX requests.

Common Solutions to Reduce AJAX Calls

1. Adjust the Plugin's AJAX Setting

Contrary to what the name implies, the 'Enable AJAX loading' option does not turn off all AJAX functions. It controls whether AJAX is used to load wishlist elements on the initial page ready event to avoid cache issues.

Action: Navigate to WP Dashboard → YITH → Wishlist → General Settings. Try toggling the 'Enable AJAX loading' option and test the result on your site. For some users, enabling this setting reduces calls; for others, disabling it works better. You must test to see what works for your specific setup.

2. Add a Custom Code Snippet

A frequently suggested solution from the YITH support team is to add a filter that prevents the wishlist from reloading when a product variation is found. This can drastically reduce AJAX calls on variable product pages.

Action: Add the following code to your active (child) theme's functions.php file:

add_filter( 'yith_wcwl_reload_on_found_variation', '__return_false' );

Important Note: This code removes AJAX calls that ensure the correct variation is added to the wishlist. If you have a caching system that might interfere with this functionality, test thoroughly after implementing this change.

3. Configure Caching Exceptions

If you use a aggressive caching solution (e.g., WP Rocket, WPEngine), you must configure it to not serve cached pages when a wishlist session is active. This prevents conflicts where cached pages contain outdated nonces or wishlist data.

Action: In your caching plugin or server-side caching rules, set an exception to bypass the cache whenever a cookie named yith_wcwl_session_* is present. The asterisk (*) is a wildcard, as the full cookie name may contain a unique identifier.

4. Check for Theme and Plugin Conflicts

Some themes, like Flatsome, have deep integrations with the wishlist plugin that can override its default AJAX behavior. Other plugins may also cause conflicts.

Action: Perform a standard conflict test:

  1. Temporarily switch to a default WordPress theme (e.g., Twenty Twenty-Three).
  2. Disable all plugins except for WooCommerce and YITH Wishlist.
  3. Check if the number of AJAX calls decreases.
  4. If it does, reactivate your theme and plugins one by one to identify the culprit.

When to Be Concerned

A few AJAX calls from the wishlist plugin are normal and necessary for its operation. However, you should investigate if you see hundreds or thousands of calls causing high server load or slowing down your site. The solutions above have proven effective for many users in mitigating these performance issues.

Remember, the goal is to find a balance between functionality and performance that works for your specific site configuration.