Title: PHP warning rest-api
Last modified: May 15, 2026

---

# PHP warning rest-api

 *  [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [1 day, 8 hours ago](https://wordpress.org/support/topic/php-warning-rest-api/)
 * We are having issues with these warnings for months. How can I resolve this?
 * PHP Warning: Attempt to read property “post_modified_gmt” on null
 * PHP Warning: Attempt to read property “post_date” on null in
 * PHP Warning: Attempt to read property “post_date_gmt” on null
 *  …/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/
   class-wc-rest-product-categories-controller.php o
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-rest-api%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Frank Remmy (woo-hc)](https://wordpress.org/support/users/frankremmy/)
 * (@frankremmy)
 * [1 day, 5 hours ago](https://wordpress.org/support/topic/php-warning-rest-api/#post-18909022)
 * Hi [@kirstinv](https://wordpress.org/support/users/kirstinv/),
 * Sorry to hear this has been going on for months — let’s get it sorted!
 * These warnings are coming from WooCommerce’s REST API product categories controller,
   which tries to read the modification date of the most recent post in each category.
   When a product category has no products assigned to it, that query returns `null`
   and PHP 8.x throws these warnings rather than handling it silently.
 * Have you noticed any functionality issues alongside these warnings, or are they
   just appearing in the logs?
 * A few things to try:
    - Go to Products → Categories and look for any categories with 0 products. Either
      assign products to them or delete them if they’re no longer needed.
    - Go to WooCommerce → Status → Tools and run “Verify base database tables” and“
      Update database”. This can fix any missing or corrupted term/post associations.
    - Could you paste your system report at [https://pastebin.com](https://pastebin.com)
      and share the link? Go to WooCommerce → Status → Get system report. That will
      help us confirm whether there’s also a known bug in your specific version 
      that’s already been patched.
 * Looking forward to your response!
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [1 day, 2 hours ago](https://wordpress.org/support/topic/php-warning-rest-api/#post-18909238)
 *     ```wp-block-code
       Hi Frank,Thank you for your quick response:) I did the first two steps but the php warnings are still showing. Can I paste the system report also here?
       ```
   
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [1 day, 2 hours ago](https://wordpress.org/support/topic/php-warning-rest-api/#post-18909242)
 * I forget to mention that we haven’t duplicated products into Dutch therefor all
   product categories in the second language are empty.. Does that matter?
 *  Plugin Support [shahzeen(woo-hc)](https://wordpress.org/support/users/shahzeenfarooq/)
 * (@shahzeenfarooq)
 * [11 hours, 45 minutes ago](https://wordpress.org/support/topic/php-warning-rest-api/#post-18909637)
 * Hi there!
 * Thank you for the update. The System Status Report contains a large amount of
   information, and forum moderators may remove messages that include too much content
   directly in the thread.
 * That is why we recommend sharing the System Status Report using [Pastebin](https://pastebin.com?utm_source=chatgpt.com)
   and then providing the generated link here.
 * > I forget to mention that we haven’t duplicated products into Dutch therefor
   > all product categories in the second language are empty.. Does that matter?
 *  Yes, that could definitely be related.
 * If the Dutch product categories exist but do not contain any translated or assigned
   products, WooCommerce or a related multilingual plugin may still attempt to access
   linked product data through the REST API, which can sometimes result in warnings
   like the ones you shared when the expected post object is missing or empty.
 * To help confirm this, could you please let us know:
    - Which multilingual plugin you are using (for example WPML, Polylang, etc.)
    - Whether the warnings stop if the second language is temporarily disabled
    - Whether all WooCommerce-related plugins are fully updated
 * You could also try creating or syncing a few translated products in Dutch and
   then check if the warnings continue appearing afterward.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-rest-api%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/)

## Tags

 * [php warnings](https://wordpress.org/support/topic-tag/php-warnings/)

 * 5 replies
 * 3 participants
 * Last reply from: [shahzeen(woo-hc)](https://wordpress.org/support/users/shahzeenfarooq/)
 * Last activity: [11 hours, 45 minutes ago](https://wordpress.org/support/topic/php-warning-rest-api/#post-18909637)
 * Status: not resolved