Warning: array_keys() [function.array-keys]:

If your encountering a warning in WordPress stating Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/yourhome/public_html/yoursite/wp-includes/widgets.php on line 1044, your not alone. This error is fairly common amongst many WordPress users just after upgrading, moving or reinstalling WordPress.

I have personally encountered  this error immediately after moving a clients WordPress installation from a subdirectory to root (and uploading the new database). It appears that somehow a dynamic sidebar widget was causing the problem. In the following simple solution, I will show you how I fixed the issue:

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/yourhome/public_html/yoursite/wp-includes/widgets.php on line 1044

warning-array_keys

How I fixed the Warning: array_keys() [function.array-keys]: Warning

  1. Login to your WordPress Admin section
  2. Navigate to Appearance > Widgets
  3. Remove any Widgets that are listed under Current Widgets and click Save Changes
  4. Visit your site to see if the error is gone
  5. Re-enable your Sidebar Widgets one by one and ensure that the error is still gone

If all goes well, this warning should be history! 😉