{"id":19009048,"date":"2026-09-01T23:23:45","date_gmt":"2026-09-01T23:23:45","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wordpress-7-1-php-warnings-undefined-array-key-type\/"},"modified":"2026-09-01T23:23:45","modified_gmt":"2026-09-01T23:23:45","slug":"wordpress-7-1-php-warnings-undefined-array-key-type","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wordpress-7-1-php-warnings-undefined-array-key-type\/","title":{"rendered":"WordPress 7.1 \u2014 PHP warnings &#8220;Undefined array key type&#8221;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">After the automatic update to WordPress 7.1, I&#8217;m getting repeated PHP warnings in my Apache error log on REST API requests:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PHP Warning: Undefined array key \"type\" in \/\u2026\/wp-includes\/rest-api.php on line 2266\nPHP Warning: Undefined array key \"type\" in \/\u2026\/wp-includes\/rest-api.php on line 2275<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What&#8217;s affected:<\/strong> My page-optimization service (FastPixel) uses the REST API to post optimized pages back to the server, and it has stopped working entirely since the update \u2014 its requests fail. The warnings above appear in my logs on requests from that service&#8217;s IP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>This is happening on two separate sites, on two separate servers<\/strong>, both of which auto-updated to 7.1. Nothing else was changed on either site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What I&#8217;ve already ruled out:<\/strong><\/p>\n\n\n\n<ul>\n<li>Deactivated every plugin individually and retested \u2014 warnings persist<\/li>\n\n\n\n<li>Switched to a default theme (from Divi) \u2014 warnings persist<\/li>\n\n\n\n<li>REST API is not restricted \u2014 <code>\/wp-json\/<\/code> returns the full JSON response normally<\/li>\n\n\n\n<li>All plugins and core are fully up to date<\/li>\n\n\n\n<li>No security plugins installed; no firewall blocks; service IPs whitelisted<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment:<\/strong> WordPress 7.1, Apache, Cloudways hosting. Site A runs PHP 8.1, Site B runs PHP 8.2 \u2014 the identical warnings appear on both, so this doesn&#8217;t appear to be PHP-version-specific.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the warnings originate in core&#8217;s <code>rest-api.php<\/code> and reproduce with all plugins disabled and a default theme active, this looks like it may be a core issue with 7.1&#8217;s REST API handling rather than a plugin conflict. Has anyone else seen this since updating to 7.1?<\/p>\n","protected":false},"template":"","class_list":["post-19009048","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19009048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19009048\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19009048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}