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

---

# PHP warning rest-api

 *  Resolved [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [3 weeks, 3 days 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%2Fpage%2F2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 16 through 24 (of 24 total)

[←](https://wordpress.org/support/topic/php-warning-rest-api/?output_format=md) 
[1](https://wordpress.org/support/topic/php-warning-rest-api/?output_format=md) 
2

 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18913215)
 * Well I did all the above. It took me a while since I had to create a staging 
   environment first but I couldn’t trigger the issue in the staging website so 
   I assumed the Php warnings were solved.. But unfortunately. I just reinstalled
   the Woocommerce plugin on the live website and now the issue appears again.. 
   But it’s showing more information now after I added some tags to all products
   in a specific category
 * [Wed May 20 09:17:30.887802 2026] [lsapi:warn] [pid 188172:tid 140011580098304][
   client 2001:1c05:78f:8200:e4ea:efe0:5467:af7f:49400] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date” on null in /home/
   u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 61\n, referer: [https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1](https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1)
   [
   Wed May 20 09:17:30.887835 2026] [lsapi:warn] [pid 188172:tid 140011580098304][
   client 2001:1c05:78f:8200:e4ea:efe0:5467:af7f:49400] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date_gmt” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 62\n, referer: [https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1](https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1)[
   Wed May 20 09:17:30.887856 2026] [lsapi:warn] [pid 188172:tid 140011580098304][
   client 2001:1c05:78f:8200:e4ea:efe0:5467:af7f:49400] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 63\n, referer: [https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1](https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1)[
   Wed May 20 09:17:30.887867 2026] [lsapi:warn] [pid 188172:tid 140011580098304][
   client 2001:1c05:78f:8200:e4ea:efe0:5467:af7f:49400] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified_gmt” on null
   in /home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/
   woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-
   controller.php on line 64\n, referer: [https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1](https://www.hetfaireoosten.nl/wp-admin/edit.php?s&post_status=all&post_type=product&lang=en&seo_filter&readability_filter&product_cat=trousers&product_type&stock_status&filter_action=Filter&paged=1)
 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18913256)
 * Hi [@kirstinv](https://wordpress.org/support/users/kirstinv/),
 * Thanks for taking the time to test this further and for sharing the updated logs,
   this additional detail is very helpful. From what you shared, the warnings now
   appear specifically when filtering products in the `trousers` category and after
   adding tags to those products. Since the warnings are coming from the WooCommerce
   REST API product categories controller trying to access a `null` post object,
   this suggests that one or more products, categories, tags, translations, or related
   taxonomy relationships may be incomplete or corrupted in the database.
 * As the issue could not be reproduced on staging, but reappeared on the live site
   after updating product taxonomy data, this points more toward site specific data
   rather than the WooCommerce core plugin files themselves.
 * To narrow this down further, please try the following on the live site or preferably
   a fresh staging copy of the live site:
    1. Run WooCommerce > Status > Tools and use: • Regenerate product lookup tables
       •
       Clear WooCommerce transients• Recount terms• Regenerate the REST API cache if
       available
    2. Check if there are any products in the `trousers` category that are: • Drafts
       •
       Trashed• Missing translations• Missing featured images or incomplete data• Duplicated
       products created by import plugins
    3. Since your site is multilingual (`lang=en` appears in the request URL), temporarily
       disable the multilingual plugin and test filtering the category again. Some 
       multilingual plugins can leave orphaned taxonomy relationships that trigger 
       these warnings.
    4. Please also temporarily disable any plugin related to: • Product filtering
       •
       SEO• Product tagging• Bulk editing/importing• Multilingual functionality
 * Then test the category filter again.
 * If the warnings still appear afterward, please share:
 * • Your System Status Report via [https://pastebin.com](https://pastebin.com) 
   or [https://quickforget.com](https://quickforget.com)
   • A screenshot of the active
   plugins page via [https://snipboard.io](https://snipboard.io)• Confirmation of
   which multilingual plugin you are using
 * That should help us narrow down exactly what object is returning as `null` here.
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18913353)
 * “related taxonomy relationships may be incomplete or corrupted in the database”
   > This must be the case that I made a mistake when cleaning up the database.
 * All the 4 steps you mention above I already did these several times and it doesn’t
   solve it. I also already deleted the product filter plugins we were using from
   Woobewoo (basic + Pro) because they kept on indexing due to missing meta keys.
   But it didn’t solve it also. See below message from the WBW plugin support.
 * _After investigating the issue, I found that the reason behind the message is
   that there is empty data in the `meta\_keys` table related to the WBW plugin,
   and the indexing process did not complete.
   I believe this happened due to a database
   cleanup or some unexpected issue.
 * The Full error log summary looks now again like this below. The previous one 
   was only because I did at tags only to this specific category ‘trousers’
 * [Wed May 20 10:03:33.137548 2026] [lsapi:warn] [pid 89363:tid 140558123079424][
   client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified_gmt” on null
   in /home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/
   woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-
   controller.php on line 64\n
   [Wed May 20 10:03:33.152675 2026] [lsapi:warn] [pid
   89363:tid 140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date” on null in /home/
   u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 61\n[Wed May 20 10:03:33.152742 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date_gmt” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 62\n[Wed May 20 10:03:33.152789 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 63\n[Wed May 20 10:03:33.152835 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified_gmt” on null
   in /home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/
   woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-
   controller.php on line 64\n[Wed May 20 10:03:33.189320 2026] [lsapi:warn] [pid
   89363:tid 140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date” on null in /home/
   u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 61\n[Wed May 20 10:03:33.189394 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_date_gmt” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 62\n[Wed May 20 10:03:33.189451 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified” on null in/
   home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/woocommerce/
   includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-controller.
   php on line 63\n[Wed May 20 10:03:33.189502 2026] [lsapi:warn] [pid 89363:tid
   140558123079424] [client 2a0b:3100:20::184:35956] [host [http://www.hetfaireoosten.nl]](http://www.hetfaireoosten.nl])
   Backend log: PHP Warning: Attempt to read property “post_modified_gmt” on null
   in /home/u86449p81279/domains/hetfaireoosten.nl/public_html/wp-content/plugins/
   woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-categories-
   controller.php on line 64\n
    -  This reply was modified 2 weeks, 5 days ago by [kirstinv](https://wordpress.org/support/users/kirstinv/).
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18913360)
 * [https://pastebin.com/9weqgiA9](https://pastebin.com/9weqgiA9)
 * All used plugin are shown in the status report. As well as WPML plugins which
   we use for translations.
 *  Plugin Support [shahzeen(woo-hc)](https://wordpress.org/support/users/shahzeenfarooq/)
 * (@shahzeenfarooq)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18915433)
 * Hi there!
 * Thank you for sharing the details. We have internally escalated your issue and
   will get back to you as soon as we have some updates.
 * Thank you for your cooperation and understanding.
 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18915442)
 * Hi [@kirstinv](https://wordpress.org/support/users/kirstinv/)
 * Months of these warnings eating your server resources is rough.
 * The root cause is orphaned data in your `wp_termmeta` table. Some product categories
   still have a `thumbnail_id` value pointing to image attachments that no longer
   exist in `wp_posts`. When the REST API loads a category, it finds that ID, tries
   to load the image post, gets null back, and PHP 8.x throws the warning. Your 
   earlier database cleanup queries removed rows from `wp_postmeta`, but the `thumbnail_id`
   references in `wp_termmeta` survived. So WooCommerce keeps trying to load images
   that are gone.
 * The tools under WooCommerce > Status won’t fix this because they don’t touch `
   wp_termmeta` thumbnail references. The fix is to remove those orphaned entries
   directly.
 * Can you please take a database backup first, then run this query through phpMyAdmin
   to see which categories have dead image references?
 *     ```wp-block-code
       SELECT tm.meta_id, tm.term_id, tm.meta_valueFROM wp_termmeta AS tmLEFT JOIN wp_posts AS p ON tm.meta_value = p.IDWHERE tm.meta_key = 'thumbnail_id'AND (p.ID IS NULL OR p.post_type != 'attachment');
       ```
   
 * If that returns results, this removes the orphaned entries:
 *     ```wp-block-code
       DELETE tm FROM wp_termmeta AS tmLEFT JOIN wp_posts AS p ON tm.meta_value = p.IDWHERE tm.meta_key = 'thumbnail_id'AND (p.ID IS NULL OR p.post_type != 'attachment');
       ```
   
 * After running the `DELETE`, clear WooCommerce transients under WooCommerce > 
   Status > Tools. The warnings should stop immediately.
 * Please note that writing or sharing custom code is beyond our [support scope](https://woocommerce.com/support-policy/),
   but I am sharing it as a goodwill gesture. So we aren’t in a position to troubleshoot
   any conflicts that may arise when using a custom snippet or further modify its
   behavior. If you need further help with customizations, I’d recommend reaching
   out to [Codeable](http://After running the DELETE, clear WooCommerce transients under WooCommerce > Status > Tools. The warnings should stop immediately.  Please note that even though we're happy to share some snippets that have been created by our engineers in the past, only core features are supported, so we aren't in a position to troubleshoot any conflicts that may arise when using a custom snippet or further modify its behavior. If you need further help with customizations, I'd recommend reaching out to Codeable. They're our official development partner with vetted WooCommerce specialists.  If the SELECT returns zero rows, let me know and we can check WPML's translated category entries instead.).
   They’re our official development partner with vetted WooCommerce specialists.
 * If the `SELECT` returns zero rows, let me know, and we can check WPML’s translated
   category entries instead.
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18915536)
 * First of all thank you for putting the effort:)
 * Unfortunately running the query ‘select…’gives an error: #1064 – Er is iets fout
   in de gebruikte syntax bij ‘tm.meta_key = ‘thumbnail_id’ LIMIT 0, 25′ in regel
   1
 * Do I need to replace something within ‘thumbnail_id’?
 * Also I can see all product categories have a tumbnail/placeholder attached in
   WP.
 * Yesterday I discovered that probably the issue indeed is with WPML entries since
   when disabling all WPML plugins the translated product categories are still existing
   in the WP-admin as I think normally they shouldn’t but Im not sure of this.. 
   But what I am sure of is which is not correct that the translated product categories
   also show in the frontend on the shop page mixed with the default language (see
   below). I contacting WPML support but there troubleshooting suggestions didn’t;
   t solve the issue yet.
 * ![](https://wordpress.org/9d7626fe-6b17-470b-9cb8-f80147ab9506)
 *  Thread Starter [kirstinv](https://wordpress.org/support/users/kirstinv/)
 * (@kirstinv)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18915543)
 * ![](https://i0.wp.com/www.hetfaireoosten.nl/wp-content/uploads/2026/05/Translated-
   Dutch-porduct-categories.png?ssl=1)
 * Translated product categories showing in second language on frontend while WPML
   plugins are deactivated.
 *  Plugin Support [Kay U a11n](https://wordpress.org/support/users/kingsleyinfo/)
 * (@kingsleyinfo)
 * [22 hours, 17 minutes ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18931135)
 * Since there’s been no recent activity on this thread, I’m marking it as resolved.
   Don’t hesitate to start a new thread if you need help in the future.
 * We’d love your feedback – please leave us a review: [https://wordpress.org/support/plugin/woocommerce/reviews/](https://wordpress.org/support/plugin/woocommerce/reviews/)

Viewing 9 replies - 16 through 24 (of 24 total)

[←](https://wordpress.org/support/topic/php-warning-rest-api/?output_format=md) 
[1](https://wordpress.org/support/topic/php-warning-rest-api/?output_format=md) 
2

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

 * 25 replies
 * 6 participants
 * Last reply from: [Kay U a11n](https://wordpress.org/support/users/kingsleyinfo/)
 * Last activity: [22 hours, 17 minutes ago](https://wordpress.org/support/topic/php-warning-rest-api/page/2/#post-18931135)
 * Status: resolved