• Resolved ytian03

    (@ytian03)


    Hi,

    Can anyone help me why searching order on Woocommerce backend is very slow? We frequently getting request time out when doing an order search. Server is good and have enough resources to process things. But request time out is frequently happening.

    TIA!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @ytian03

    Thanks for reaching out!

    I understand that you are experiencing slow search performance and frequent request timeouts when searching for orders in the WooCommerce backend.

    There could be several reasons for the slow performance of order searches. Here are some possible solutions to consider:

    1. Database optimization: Over time, your database may accumulate unnecessary data, such as old revisions, expired transients, and orphaned metadata. This can slow down your search performance. To optimize your database, you can use a plugin like WP-Optimize or WP-Sweep to clean up and optimize your database.
    2. Search optimization: By default, WooCommerce searches for orders based on the order ID, customer details, and order items. You can try using search optimization plugins to improve search performance by indexing your order data and providing more efficient search algorithms.
    3. Server-side caching: If your server has enough resources, you can implement server-side caching to speed up the search process. This can be done using caching plugins like W3 Total Cache or WP Rocket, or by implementing server-side caching solutions like Varnish or Redis.
    4. Updating plugins and themes: Ensure that all your plugins and themes are up to date, as outdated software can cause performance issues. Also, consider disabling any unnecessary plugins to reduce the load on your server.

    If these did not resolve the issue, I’d like to understand your site properly. Please share your System Status Report that you can find via WooCommerce > Status. Select Get system report and then Copy for support. Once you’ve done that, you can paste it into your reply here.

    If you could also provide the fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Thanks!

    I’m having same issue with 240k Orders with timeouts on searching. Add this code to functions.php to limit what fields get searched. It speeds things up a lot! (generated by Chatgpt and works great )

    // Limit WooCommerce order searches to email, name, order ID, and shipping name for admins and shop managers
    function limit_order_search_fields($search_fields) {
    if (current_user_can(‘manage_options’) || current_user_can(‘manage_woocommerce’)) {
    if (is_admin() && class_exists(‘woocommerce’) && isset($_GET[‘post_type’]) && $_GET[‘post_type’] === ‘shop_order’) {
    $search_fields = array(
    ‘_billing_email’,
    ‘_billing_address_index’,
    ‘_billing_first_name’,
    ‘_billing_last_name’,
    // ‘_shipping_first_name’,
    // ‘_shipping_last_name’,
    ‘ID’
    );
    }
    }
    return $search_fields;
    }
    add_filter(‘woocommerce_shop_order_search_fields’, ‘limit_order_search_fields’);

    • This reply was modified 1 year, 5 months ago by kattouf.
    Plugin Support Andrew DS a11n

    (@druesome)

    @kattouf Thanks for sharing that!

    @ytian03 you can also add the snippet using the Code Snippets plugin. Adding it to your theme’s functions.php file will mean that you’ll have to it again when the theme updates.

    https://jetpack.com/support/adding-code-snippets/

    yes use a snippets plugin or child theme.

    P.S the billing_address_index field contains all the billing details, so no need to even search first or last name either…. ??

    • This reply was modified 1 year, 4 months ago by kattouf.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce Order Search is too slow’ is closed to new replies.