Title: PHP error in_array() expects parameter 2 to be array, null given
Last modified: October 30, 2018

---

# PHP error in_array() expects parameter 2 to be array, null given

 *  Resolved [paw78](https://wordpress.org/support/users/paw78/)
 * (@paw78)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php-error-in_array-expects-parameter-2-to-be-array-null-given/)
 * Hi,
    I have recently started getting this PHP error.
 * Warning: in_array() expects parameter 2 to be array, null given in /home/hanmermc/
   public_html/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 
   3868
 * My client indicates they have made no changes to the wordpress All in One SEO
   Pack or their theme/site.
 * It only appears to be happening on their home page.
 * I understand what the error means, just not sure what is actually causing it.
 * Any thoughts?
    Thanks, Paul.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-error-in_array-expects-parameter-2-to-be-array-null-given%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [creativepickle](https://wordpress.org/support/users/creativepickle/)
 * (@creativepickle)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-error-in_array-expects-parameter-2-to-be-array-null-given/#post-10872246)
 * This happened to my client and at least in my case, it was fixed by changing 
   the settings for the homepage to Static Homepage and adding the homepage SEO 
   details on the page itself. Hope that helps.
 *  [k790](https://wordpress.org/support/users/k790/)
 * (@k790)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-error-in_array-expects-parameter-2-to-be-array-null-given/#post-10876540)
 * My solution to the problem:
    [https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2054](https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2054)
 * > It seems I understood, after updating my homepage’s html code, it disappeared:
   > `
   > <link rel = "canonical" href = "http: //domain.dom/" />` Rummaging in SEO settings:
   > No Pagination for Canonical URLs
   > I turned on the option and the problem disappeared, turned off the option and
   > the problem did not appear, but in the code I found `<link rel = "canonical"
   > href = "http: //domain.dom/" />`
   > Most likely when updating the value of the variable is lost and because of 
   > this error …
   > Related link:
   >  [https://github.com/semperfiwebdesign/all-in-one-seo-pack/commit/4012f3963f9854fad0475eaf974eb1eee62598f9](https://github.com/semperfiwebdesign/all-in-one-seo-pack/commit/4012f3963f9854fad0475eaf974eb1eee62598f9)

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

The topic ‘PHP error in_array() expects parameter 2 to be array, null given’ is 
closed to new replies.

 * ![](https://ps.w.org/all-in-one-seo-pack/assets/icon.svg?rev=2443290)
 * [All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic](https://wordpress.org/plugins/all-in-one-seo-pack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-seo-pack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-seo-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [k790](https://wordpress.org/support/users/k790/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/php-error-in_array-expects-parameter-2-to-be-array-null-given/#post-10876540)
 * Status: resolved