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 to see the link]
-
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] 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
[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] 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
[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] 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
[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] 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=1Hi @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
trouserscategory and after adding tags to those products. Since the warnings are coming from the WooCommerce REST API product categories controller trying to access anullpost 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:
- Run WooCommerce > Status > Tools and use: • Regenerate product lookup tables
• Clear WooCommerce transients
• Recount terms
• Regenerate the REST API cache if available - Check if there are any products in the
trouserscategory that are: • Drafts
• Trashed
• Missing translations
• Missing featured images or incomplete data
• Duplicated products created by import plugins - Since your site is multilingual (
lang=enappears 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. - 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 or https://quickforget.com
• A screenshot of the active plugins page via https://snipboard.io
• Confirmation of which multilingual plugin you are usingThat should help us narrow down exactly what object is returning as
nullhere.“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_keystable 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] 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] 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] 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] 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] 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] 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] 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] 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] 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 1 week, 1 day ago by
kirstinv.
All used plugin are shown in the status report. As well as WPML plugins which we use for translations.
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.
Hi @kirstinv
Months of these warnings eating your server resources is rough.
The root cause is orphaned data in your
wp_termmetatable. Some product categories still have athumbnail_idvalue pointing to image attachments that no longer exist inwp_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 fromwp_postmeta, but thethumbnail_idreferences inwp_termmetasurvived. 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_termmetathumbnail 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?
SELECT tm.meta_id, tm.term_id, tm.meta_value
FROM wp_termmeta AS tm
LEFT JOIN wp_posts AS p ON tm.meta_value = p.ID
WHERE tm.meta_key = 'thumbnail_id'
AND (p.ID IS NULL OR p.post_type != 'attachment');If that returns results, this removes the orphaned entries:
DELETE tm FROM wp_termmeta AS tm
LEFT JOIN wp_posts AS p ON tm.meta_value = p.ID
WHERE 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, 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. They’re our official development partner with vetted WooCommerce specialists.
If the
SELECTreturns zero rows, let me know, and we can check WPML’s translated category entries instead.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.

Translated product categories showing in second language on frontend while WPML plugins are deactivated.
- Run WooCommerce > Status > Tools and use: • Regenerate product lookup tables
You must be logged in to reply to this topic.