Title: php warning Undefined array key
Last modified: April 30, 2024

---

# php warning Undefined array key

 *  Resolved [hllwrld](https://wordpress.org/support/users/hllwrld/)
 * (@hllwrld)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-17/)
 * Hi !
 * someone has set up a WordPress instance for me (6.5.2).
   So they did : website
   works well.However, when I connect to admin pages [https://mywebsite/wp-admin/profile.php](https://mywebsite/wp-admin/profile.php),
   I have multiple php warnings :
 *     ```wp-block-code
       Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/menu.php on line 181
   
       Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/plugin.php on line 2012
   
       Warning: Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/includes/plugin.php on line 2012
   
       Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 155
   
       Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 156
   
       Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 164
   
       Warning:  Undefined array key 2 in /home/clients/<id>/sites/mywebsite/wp-admin/menu-header.php on line 171
       ```
   
 * This happens only when connecting admin pages with limited privileges (I have
   tried Author and Editor).
   The warnings don’t appear when connecting with privileges
   = Administrator : **I have tried granting Admin privileges, it fixes the bug 
   but I don’t want all users having Admin privileges**, so I reverted and the bug
   came back…
 * Versions/Details :
    - WordPress 6.5.2
    - advanced extensions : 1 = advanced-cache.php
    - Theme : Divi Child (Divi-child-theme) / Parent Divi (Divi)
    - Server : Linux
    - web server : Apache
    - php : 8.2.16
    - DB : MariaDB 10.6
 * Note :
    - I have tried to use php 8.1 and 8.0 ; bug is still present
    - **I have tried using php 7.4, so bug disappears, but I reverted to 8.2 as 
      I don’t want using an obsolete version of php**
    - I have tried emptying cache or disabling it, it doesn’t impact the bug
 * To mention : the DB was MySQL 5.6 until recently (bug was already there). I have
   migrated to MariaDB 10.6 recently but bug is still there 🙁
 * Thanks in advance

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

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-17/#post-17725042)
 * This problem may be a plugin or theme conflict. Please attempt to deactivate 
   all plugins and switch to the default Twenty Twenty-Three theme. If the problem
   goes away, re-activate them one by one to identify the source of the problem.
 * If you can install plugins, install [Health Check](https://wordpress.org/plugins/health-check/).
   On the troubleshooting tab, you can click the button to deactivate all plugins
   and change the theme for you while you’re still logged in **without affecting
   normal visitors to your site**.
 *  Thread Starter [hllwrld](https://wordpress.org/support/users/hllwrld/)
 * (@hllwrld)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-17/#post-17726822)
 * Hi !
 * Thank you for the very good advice. I have deactivated all plugins, and the problem
   is gone.
   I will investigate for the exact one causing the trouble and check if
   it is necessary.
 * All the best

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

The topic ‘php warning Undefined array key’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [hllwrld](https://wordpress.org/support/users/hllwrld/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-17/#post-17726822)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
