500 error on url_esc on old url with /page/2

This topic has 2 replies, 2 voices, and was last updated 2 weeks, 4 days ago ago by Ayan Rahman

  • Avatar: Peter
    Peter
    Participant
    February 23, 2026 at 23:41

    Calling a old url (category removed

    https://site/product-category/old/page/2/

    Stack dump:

    WebTransaction/Action/header-footer
    TypeError:
    Uncaught exception ‘TypeError’ with message ‘ltrim(): Argument #1 ($string) must be of type string, WP_Error given’ in /httpdocs/wp-includes/formatting.php:4486

    in ltrim called at /httpdocs/wp-includes/
    formatting.php (4486)

    in esc_url called at httpdocs/wp-content/themes/xstore/woocommerce/global/
    breadcrumb.php (99)

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Ayan Rahman
    Ayan Rahman
    Support staff
    February 24, 2026 at 10:07

    Hello,

    Thank you for reaching out to us.

    – The error you are experiencing occurs because the requested URL refers to a category that has been removed, which causes the function to receive an unexpected value instead of a valid string. Please make sure that all category links used on your website are active and valid. You may also clear any cached data or update your permalinks under Settings > Permalinks in your WordPress dashboard to ensure all links are refreshed.

    – It is possible that the cause of this is related to cached data.
    We kindly recommend clearing the cache after making changes to products and categories. This includes clearing WooCommerce-related caches, which can be found in the following section:
    WooCommerce > Status > Tools
    Please ensure you clear the following fields:
    – WooCommerce transients
    – Expired transients
    – Term counts
    – Brands transients

    – We can’t log in to your site – https://gyazo.com/a3cc4c3924e1c0e275202cbc2a94d4a4

    – Could you please test if the same issue occurs when using a default theme, such as Storefront? (Appearance — Themes).
    If the behavior continues regardless of the theme being used, it suggests that the problem may not be related to the theme itself. In this case, we would recommend you contact support of woocommerce plugin – https://wordpress.org/support/plugin/woocommerce/

    Best Regards,
    8Theme’s Team

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.