Ready to get started?Download WordPress


All in One SEO Pack
[resolved] Undefined variable: description (8 posts)

  1. styledev
    Posted 1 year ago #

    In file: aioseop_class.php
    Error: Notice: Undefined variable: description in /Users/.../wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 1027

    Line: 1027: $description = apply_filters( 'aioseop_description', $description );

    Change to the following to fix:

    if ( isset($description) ) $description = apply_filters( 'aioseop_description', $description );

    Seen when accessing WooCommerce /shop page.


  2. Casey Picker
    Posted 11 months ago #

    Awesome! Was just looking for this. Thanks!

  3. Peter Baylies
    Plugin Author

    Posted 11 months ago #

    What I would suggest doing, and what will be the fix in the next version, is to set $description to the empty string much earlier in the wp_head() function there; that'd look like this:

    $description = '';

    The issue with your fix is, it prevents the aioseop_description filter from running when there isn't a description present.

  4. styledev
    Posted 11 months ago #

    Thanks for weighing in on this!

  5. michael
    Posted 9 months ago #

    I'm getting the same warning. but it only happens in my custom post type archive pages.

    adding $description = ''; right above wp_head() didn't work. any ideas?

  6. michael
    Posted 9 months ago #

    i misunderstood. I added $description = ''; in header.php - right above wp_head().

    adding it in all-in-one-seo-pack\aioseop_class.php wp_head() did the trick. per @Peter Baylies - the fix will be in the next plugin release i hope.

  7. Peter Baylies
    Plugin Author

    Posted 9 months ago #


    Glad you fixed it! Yes, as I said, this fix will be in the next release.

  8. brynte
    Posted 4 months ago #

    There seems to have been several updates since this issue was resolved, still I get the same error.

    My message reads:
    Notice: Undefined variable: author in /storage/content/85/106985/bryntemedia.se/public_html/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 1378

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic