• Resolved sanjuanpan

    (@sanjuanpan)


    Hello,

    I got this error just after update to lates version 14.0.1:

    Warning: in_array() expects parameter 2 to be array, null given in /home/mysite/public_html/wp-content/plugins/wordpress-seo/src/helpers/robots-helper.php on line 27

    How can I fix it?

    Thanks in advance,

    AS

Viewing 8 replies - 1 through 8 (of 8 total)
  • In addition to this error above it got:

    Warning: in_array() expects parameter 2 to be array, null given in XXX/wp-content/plugins/wordpress-seo/src/helpers/robots-helper.php on line 27

    Notice: Undefined property: Yoast\WP\SEO\Presentations\Indexable_Term_Archive_Presentation::$robots in XXX/wp-content/plugins/wordpress-seo/src/helpers/robots-helper.php on line 31

    I’m getting the same exact error message after updating the Yoast SEO plugin:

    Warning: in_array() expects parameter 2 to be array, null given in ///wp-content/plugins/wordpress-seo/src/helpers/robots-helper.php on line 27.

    I too offer a “thank you” in advance for any help or a fix for this.

    Yep, broke my site as well….

    Hi Guys, here is a FIX – hopefully yoast will fix this in the next update.
    1. Access your site either using the cPanel File Manager or FTP.
    2. Look for and edit the following file: wp-content/plugins/wordpress-seo/src/helpers/robots-helper.php
    3. Replace lines 27-29 which currently read:
    if ( in_array( ‘noindex’, $presentation->robots, true ) ) {
    return $robots;
    }
    with:
    if ( is_array( $presentation->robots ) ) {
    if ( in_array( ‘noindex’, $presentation->robots, true ) ) {
    return $robots;
    }
    }
    4. Save the file

    That’s It!

    • This reply was modified 4 years, 10 months ago by swsupport.
    Plugin Support devnihil

    (@devnihil)

    @sanjuanpan @mattce @kpenn @bencalder If you update to the most current version of Yoast SEO version 14.0.4, does this resolve the issue? You can learn more about updating here: https://kb.yoast.com/kb/how-can-i-update-my-free-plugin/

    We apologize for any trouble caused. Can you please confirm if the issue is now resolved with Yoast SEO 14.0.4?

    Thread Starter sanjuanpan

    (@sanjuanpan)

    Hello, yes is solved in my case. Regards.

    Plugin Support devnihil

    (@devnihil)

    @sanjuanpan Thanks for confirming that the 14.0.4 update corrected the issue for you. We are going ahead and marking this issue as resolved. If you require any further assistance please create a new issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Error after update to v14.0.1’ is closed to new replies.