Title: Undefined array key &#8220;path&#8221;
Last modified: January 13, 2024

---

# Undefined array key “path”

 *  Resolved [ubuntuhandbook1](https://wordpress.org/support/users/ubuntuhandbook1/)
 * (@ubuntuhandbook1)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-path-4/)
 * Hi Auctollo,
 * First thank you for the plugin. I’ve been using the plugin for many years, it’s
   working great.
 * But, after upgrading to PHP 8.1, it shows warnings:
 * _PHP Warning: Undefined array key “path” in /usr/share/nginx/www/wp-content/plugins/
   google-sitemap-generator/class-googlesitemapgeneratorloader.php on line 779″_
 * And, here’s the the corresponding code:
 * _public static function change\_url\_to\_required(){
   global $wp;$current\_url
   = parse\_url(home\_url(add\_query\_arg(array(), $wp->request)));if(strlen($current\
   _url[‘path’]) > 1){$currentUrl = substr($current\_url[‘path’], 1);$arrayType 
   = explode(‘.’, $currentUrl);if (in\_array($arrayType[1], array(‘xml’, ‘html’))){
   if( strpos($arrayType[0], ‘sitemap-misc’) !== false ) {$postType[0] = ‘sitemap’;
   $postType[1] = $arrayType[1];}else $postType = explode(‘-sitemap’, $currentUrl);
 * I know this is just a warning, but it’s getting full in nginx error.log. So, 
   I want to know, if there’s a workaround to disable it.
 * After searching around, I found:
 * _if (isset($current\_url[‘path’])) {return false;}_
 * But I don’t know if it will make the plugin work incorrectly. Please help.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Auctollo](https://wordpress.org/support/users/auctollo/)
 * (@auctollo)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/undefined-array-key-path-4/#post-17348163)
 * [@ubuntuhandbook1](https://wordpress.org/support/users/ubuntuhandbook1/) thanks
   for reporting this, it will be fixed in the next release (coming this week).

Viewing 1 replies (of 1 total)

The topic ‘Undefined array key “path”’ is closed to new replies.

 * ![](https://ps.w.org/google-sitemap-generator/assets/icon-256x256.png?rev=2713572)
 * [XML Sitemap Generator for Google](https://wordpress.org/plugins/google-sitemap-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-sitemap-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-sitemap-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-sitemap-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-sitemap-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-sitemap-generator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Auctollo](https://wordpress.org/support/users/auctollo/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/undefined-array-key-path-4/#post-17348163)
 * Status: resolved