Title: Undefined array key &#8220;in_span&#8221;
Last modified: December 12, 2025

---

# Undefined array key “in_span”

 *  Resolved [laaau89](https://wordpress.org/support/users/laaau89/)
 * (@laaau89)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/)
 * Hi there,
 * since a few months my file php_errorlog gets filled with thousands and thousands
   of rows (on average 1 to 5 rows created per minute!) saying:
 * `PHP Warning: Undefined array key "in_span" in /home/customer/www/[SITE_URL]/
   public_html/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php
   on line 645`
 * The issue is created by the row:
 * `if ( $args['in_span'] ) {`
 * If I replace it with:
 * `if ( isset($args['in_span']) ) {`
 * then I don’t get the error warning anymore. But then WooCommerce gets updated
   and I have the same issue again.
 * It seems like a general WooCommerce error, but I haven’t found much information
   on the Internet about that, so could it be specific to my installation?
 * System Status Report
 *     ```wp-block-code
       ### WordPress Environment ###WordPress address (URL): [Redacted]Site address (URL): [Redacted]WC Version: 10.4.0Legacy REST API Package Version: ✔ 1.0.5Action Scheduler Version: ✔ 3.9.3Log Directory Writable: ✔WP Version: 6.9WP Multisite: –WP Memory Limit: 768 MBWP Debug Mode: –WP Cron: –Language: en_USExternal object cache: –### Server Environment ###Server Info: ApacheServer Architecture: Linux 6.6.63-MCIclouder663-c9 x86_64PHP Version: 8.2.29PHP Post Max Size: 256 MBPHP Time Limit: 120PHP Max Input Vars: 3000cURL Version: 8.9.1OpenSSL/3.2.6SUHOSIN Installed: –MySQL Version: 8.0.43-34Max Upload Size: 256 MBDefault Timezone is UTC: ✔fsockopen/cURL: ✔SoapClient: ✔DOMDocument: ✔GZip: ✔Multibyte String: ✔Remote Post: ✔Remote Get: ✔### Database ###[REDACTED]### Post Type Counts ###attachment: 11721cookielawinfo: 6custom_css: 1flamingo_contact: 1222flamingo_inbound: 1200foogallery: 24gs_testimonial: 2nav_menu_item: 1084oembed_cache: 2page: 70post: 1premium_shipping: 9product: 3301product_variation: 12612rcb-cookie: 2revision: 1841shop_coupon: 803shop_order: 20669shop_order_refund: 836testimonial: 11tss-sc: 1vxc_zoho: 3wpcf7_contact_form: 2wplconsentlogs: 465wpmm_theme: 3wp_global_styles: 1### Security ###Secure connection (HTTPS): ✔Hide errors from visitors: ✔### Active Plugins (26) ###Complianz | GDPR/CCPA Cookie Consent: by Complianz – 7.4.4.1Contact Form 7: by Rock Lobster Inc. – 6.1.4Disk Usage Insights: by Marcel Gleis – 1.9GTM4WP - A Google Tag Manager (GTM) plugin for WordPress: by Thomas Geiger – 1.22.2FooBox Image Lightbox: by FooPlugins – 2.7.35FooGallery: by FooPlugins – 3.1.1Fr Custom Payment Gateway Icon for WooCommerce: by Fahri Rusliyadi – 1.1.2Max Mega Menu: by megamenu.com – 3.6.2Multilingual Comments: by Yame – 1.0.1MultiSafepay: by MultiSafepay – 6.10.0Speed Optimizer: by SiteGround – 7.7.5Side Cart WooCommerce: by XootiX – 2.7.2Simple CAPTCHA Alternative with Cloudflare Turnstile: by Elliot SowersbyRelyWP – 1.35.0WPML Multilingual CMS: by OnTheGoSystems – 4.9.0-b.1Super Socializer: by Team Heateor – 7.14.5WooCommerce Additional Variation Images: by WooCommerce – 2.3.2WooCommerce All in One Currency Converter: by Dev49.net – 2.12.1WooCommerce EU VAT Number: by WooCommerce – 2.9.2 (update to version 3.0.3 is available)Google Analytics for WooCommerce: by WooCommerce – 2.1.19WooCommerce Legacy REST API: by WooCommerce – 1.0.5WPML Multilingual & Multicurrency for WooCommerce: by OnTheGoSystems – 5.5.3.1WooCommerce PayPal Payments: by PayPal – 3.3.1WooCommerce: by Automattic – 10.4.0WP Paint - WordPress Image Editor: by ZetaMatic – 0.5.3WPML String Translation: by OnTheGoSystems – 3.5.0-b.1Yoast SEO: WooCommerce: by Team Yoast – 13.2### Inactive Plugins (3) ###CookieYes | GDPR Cookie Consent: by CookieYes – 3.3.8WP Consent API: by WordPress Contributors – 2.0.0WP Cookie Consent: by WP Legal Pages – 4.0.7### Settings ###Legacy API Enabled: ✔Force SSL: ✔Currency: EUR (€)Currency Position: right_spaceThousand Separator: .Decimal Separator: ,Number of Decimals: 2Taxonomies: Product Types: external (external)grouped (grouped)simple (simple)variable (variable)Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)exclude-from-search (exclude-from-search)featured (featured)outofstock (outofstock)rated-1 (rated-1)rated-2 (rated-2)rated-3 (rated-3)rated-4 (rated-4)rated-5 (rated-5)Connected to WooCommerce.com: ✔Enforce Approved Product Download Directories: –HPOS feature enabled: –Order datastore: WC_Order_Data_Store_CPTHPOS data sync enabled: ✔Enabled Features: analyticsmarketplaceorder_attributionsite_visibility_badgeremote_loggingblueprintpoint_of_sale### Logging ###Enabled: ✔Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2Retention period: 30 daysLevel threshold: –Log directory size: 3 MB### WC Pages ###Shop base: #45192 - /negozio/Cart: #6619 - /cart/ -  Contains the [woocommerce_cart] shortcodeCheckout: #6620 - /checkout/ -  Contains the [woocommerce_checkout] shortcodeMy account: #6621 - /account/ -  Contains the [woocommerce_my_account] shortcodeTerms and conditions: #36031 - /terms-and-conditions/### Theme ###Name: Maxi ThemeVersion: 2Author URL: Child Theme: ✔Parent Theme Name: StorefrontParent Theme Version: 4.6.2Parent Theme Author URL: https://woocommerce.com/Theme type: Classic themeWooCommerce Support: ✔### Templates ###Overrides: maxi_theme/woocommerce/cart/cart-shipping.phpmaxi_theme/woocommerce/cart/cart-totals.phpmaxi_theme/woocommerce/cart/cart.phpmaxi_theme/woocommerce/cart/mini-cart.phpmaxi_theme/woocommerce/cart/proceed-to-checkout-button.phpmaxi_theme/woocommerce/cart/shipping-calculator.phpmaxi_theme/woocommerce/checkout/form-billing.phpmaxi_theme/woocommerce/checkout/payment.phpmaxi_theme/woocommerce/checkout/review-order.phpmaxi_theme/woocommerce/checkout/thankyou.phpmaxi_theme/woocommerce/content-product.phpmaxi_theme/woocommerce/content-single-product.phpmaxi_theme/woocommerce/emails/email-addresses.phpmaxi_theme/woocommerce/emails/email-order-items.phpmaxi_theme/woocommerce/emails/email-styles.phpmaxi_theme/woocommerce/loop/add-to-cart.phpmaxi_theme/woocommerce/myaccount/dashboard.phpmaxi_theme/woocommerce/myaccount/form-edit-address.phpmaxi_theme/woocommerce/myaccount/my-address.phpmaxi_theme/woocommerce/myaccount/navigation.phpmaxi_theme/woocommerce/myaccount/orders.phpmaxi_theme/woocommerce/myaccount/view-order.phpmaxi_theme/woocommerce/order/order-details-item.phpmaxi_theme/woocommerce/order/order-details.phpmaxi_theme/woocommerce/single-product/add-to-cart/simple.phpmaxi_theme/woocommerce/single-product/add-to-cart/variable.phpmaxi_theme/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.phpmaxi_theme/woocommerce/single-product/add-to-cart/variation.phpmaxi_theme/woocommerce/single-product/price.phpmaxi_theme/woocommerce/single-product/related.php### WooCommerce PayPal Payments ###Onboarded: ✔Branded only: –New UI active: –Shop country code: ITWooCommerce currency supported: ✔Advanced Card Processing available in country: ✔Pay Later messaging available in country: ✔Webhook status: ✔PayPal Vault enabled: –ACDC Vault enabled: –Logging enabled: –Reference Transactions: –Used PayPal Checkout plugin: ✔Subscriptions Mode: DisabledPayPal Shipping Callback: –Apple Pay: ✔Google Pay: ✔Fastlane: –### Admin ###Enabled Features: activity-panelsanalyticsproduct-block-editorexperimental-iapi-mini-cartcouponscore-profilercustomize-storecustomer-effort-score-tracksimport-products-taskexperimental-fashion-sample-productsshipping-smart-defaultsshipping-setting-tourhomescreenmarketingmobile-app-banneronboardingonboarding-taskspattern-toolkit-full-composabilityproduct-custom-fieldsremote-inbox-notificationsremote-free-extensionspayment-gateway-suggestionsprintfulshipping-label-bannersubscriptionsstore-alertstransient-noticeswoo-mobile-welcomewc-pay-promotionwc-pay-welcome-pagelaunch-your-storeDisabled Features: product-data-viewsexperimental-blocksexperimental-iapi-runtimecoming-soon-newsletter-templateminified-jsproduct-pre-publish-modalproducts-catalog-apisettingsasync-product-editor-category-fieldproduct-editor-template-systemuse-wp-horizonrest-api-v4Daily Cron: ✔ Next scheduled: 2025-12-12 14:15:17 +01:00Options: ✔Notes: 262Onboarding: completed### Action Scheduler ###Complete: 967Oldest: 2025-12-02 09:32:03 +0100Newest: 2025-12-12 09:21:05 +0100Pending: 14Oldest: 2025-12-12 10:04:27 +0100Newest: 2025-12-13 04:54:52 +0100### Status report information ###Generated at: 2025-12-12 09:58:56 +01:00
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-in_span%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Frank Remmy (woo-hc)](https://wordpress.org/support/users/frankremmy/)
 * (@frankremmy)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18753475)
 * Hi [@laaau89](https://wordpress.org/support/users/laaau89/),
 * Thank you for sharing these details about the PHP warning in your error log. 
   I understand how frustrating it can be to deal with thousands of repeated warnings,
   especially when they persist after updates.
 * The warning you’re seeing suggests that somewhere in your setup, the `wc_price()`
   function (or a related formatting function) is being called without the expected`
   in_span` parameter in the arguments array. This could be caused by:
    - Your custom theme templates might be calling WooCommerce functions with incomplete
      parameters
    - One of your active plugins might be calling WooCommerce formatting functions
      incorrectly
    - Any custom code in your functions.php or elsewhere that calls WooCommerce 
      price formatting functions
 * To troubleshoot this:
    1. I notice you have many custom templates in your `maxi_theme` folder. Look for
       any calls to `wc_price()` or similar functions in these files.
    2. I know you’re using the Storefront theme, but temporarily switch to a default
       WordPress theme, such as Twenty Twenty-Four, or your parent theme, to see if
       the warnings stop.
    3. Try deactivating plugins one by one to identify if any are causing the issue.
    4. If your site or child theme includes custom code using WooCommerce formatting
       functions, verify that `$args` arrays always include the ‘in_span’ key when 
       passed.
 * I hope that helps. Let us know how it goes!
 *  Thread Starter [laaau89](https://wordpress.org/support/users/laaau89/)
 * (@laaau89)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18753506)
 * Thank you Frank for your reply! I confirm that my functions.php calls 9 times
   _wc\_price()_.
 * However, I see that _wc\_price()_ expects _$price_ (required) and _$args_ (optional)._
   $args_ is made of 7 possible different values, _$in\_span_ included, but I’m 
   never passing any _$args_ at all – being optional. Why would just the optional_
   $in\_span_, out of all of them, raise the warning?
 * Anyway, I’ll troubleshoot (it will take me some time) and let you know, thanks.
 *  Plugin Support [Frank Remmy (woo-hc)](https://wordpress.org/support/users/frankremmy/)
 * (@frankremmy)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18753925)
 * Hi [@laaau89](https://wordpress.org/support/users/laaau89/),
 * Great questions! You’ve identified the root cause. 
 * When you call `wc_price()` without the optional `$args` parameter, WooCommerce
   should handle this correctly. However, the warning suggests that somewhere in
   your code flow, an array is being passed or expected that doesn’t contain the`
   in_span` key. This could happen if:
    1. Your functions.php code is modifying or passing arrays that get used later in
       the formatting process
    2. You’re using hooks or filters that modify the arguments before they reach the
       formatting functions
    3. There’s custom code that builds an `$args` array but doesn’t include all expected
       keys
 * Let us know how your troubleshooting goes so we see.
 *  Thread Starter [laaau89](https://wordpress.org/support/users/laaau89/)
 * (@laaau89)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18757557)
 * Hi Frank,
 * just to let you know that I’ve checked my functions.php and the issue is not 
   related to my custom theme. All my wc_price() calls pass just the price parameters,
   and the problem persists even after removing them.
 * It might be a plugin. This will take me longer to debug, as I will have to create
   a staging site first.
   Anyway, thank you for giving me the hints on what to check.
   Appreciate your assistance!
 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [6 months ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18757566)
 * Hi [@laaau89](https://wordpress.org/support/users/laaau89/), I appreciate you
   coming back with the update and taking the time to test this further. It is clear
   you have been methodical with your checks, and I can see how frustrating it is
   when the warning persists even after ruling out your custom theme and direct `
   wc_price()` calls.
 * Given what you have confirmed so far, this does point much more strongly to a
   plugin or custom integration that is filtering or rebuilding the arguments passed
   into WooCommerce formatting functions and omitting the `in_span` key. This aligns
   with what we typically see when a plugin hooks into price formatting or display
   logic and passes a partial `$args` array instead of letting WooCommerce merge
   defaults internally.
 * At this stage, setting up a staging site is a solid next step, as you mentioned.
   On staging, I recommend running a plugin conflict test by temporarily deactivating
   all non WooCommerce plugins and then re enabling them one at a time until the
   warning reappears. That should help narrow down which plugin is injecting or 
   modifying the arguments incorrectly. This guide walks through that process in
   detail: [https://woocommerce.com/document/how-to-test-for-conflicts/](https://woocommerce.com/document/how-to-test-for-conflicts/)
 * Once you identify the plugin involved, the best path is to report this directly
   to that plugin’s developer, as the fix needs to happen where the arguments are
   being altered. If you do find a specific plugin causing it, feel free to update
   the thread here and we can take another look together.
 * Thanks again for sharing your findings so far, and let us know how it goes once
   you have a chance to test on staging.
 *  Plugin Support [Feten L. a11n](https://wordpress.org/support/users/fetenlakhal/)
 * (@fetenlakhal)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18766517)
 * Hi there,
 * Just checking in! Since it’s been a while, I’ll go ahead and close this out —
   but feel free to reach out whenever you’re ready.
 * Apart from this, if you’re happy with our plugin and the support you’ve received,
   we’d really appreciate a review: [https://wordpress.org/support/plugin/woocommerce/reviews/#new-post](https://wordpress.org/support/plugin/woocommerce/reviews/#new-post)

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-in_span%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [Feten L. a11n](https://wordpress.org/support/users/fetenlakhal/)
 * Last activity: [5 months, 3 weeks ago](https://wordpress.org/support/topic/undefined-array-key-in_span/#post-18766517)
 * Status: resolved