Title: Undefined property: WP_Query::$post
Last modified: August 21, 2016

---

# Undefined property: WP_Query::$post

 *  Resolved [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/)
 * On any “Add” page in the All in One SEO Pack box I am seeing three notices when
   WP_DEBUG mode is turned on:
 * Notice: Undefined property: WP_Query::$post in /Users/dbushaw/Sites/technobuffalo/
   wp-includes/query.php on line 3017
 * Notice: Undefined property: WP_Query::$post in /Users/dbushaw/Sites/technobuffalo/
   wp-includes/query.php on line 3017
 * Notice: Trying to get property of non-object in /Users/dbushaw/Sites/technobuffalo/
   wp-includes/query.php on line 3496
 * Can you look into fixing this?
 * [http://wordpress.org/extend/plugins/all-in-one-seo-pack/](http://wordpress.org/extend/plugins/all-in-one-seo-pack/)

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

 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734080)
 * styledev,
 * Sure; do you have any other plugins that show up on that screen as well? I haven’t
   seen this error before, so it’d be nice to know if this is a conflict with another
   plugin or with your theme.
 *  Thread Starter [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734084)
 * I thought that might be the case to so I disabled all other plugins and activated
   the Twenty Twelve theme and still saw the same notices.
 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734090)
 * styledev,
 * Thanks for that; try commenting out or removing line 455 of aioseop_class.php–
   it should look like this in the plugin:
 * `$wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type));`
 * Let me know if that fixes your issue and if the snippet displays properly and
   things work otherwise. It looks like WordPress goes to some lengths here to set
   up a new empty post before it’s created, and the plugin was unkindly querying
   for it before it exists there; hence, get_queried_object() complains about it.
 *  Thread Starter [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734171)
 * That works, I put a conditional on line 455 instead of commenting it out permanently.
   Can you test this and if you are cool with it put it into the next version? I
   would greatly appreciate it.
 * `if (! $post->post_modified_gmt != '' )`
 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734176)
 * Interesting double negation there; would is_empty() work here? I’ll test, thank
   you.
 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734178)
 * styledev,
 * Ok; update pushed, and your fix is in; thank you!
 *  Thread Starter [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734185)
 * Works perfect, thank you for working on this with me.

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

The topic ‘Undefined property: WP_Query::$post’ 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/)

## Tags

 * [notice](https://wordpress.org/support/topic-tag/notice/)
 * [Undefined property](https://wordpress.org/support/topic-tag/undefined-property/)

 * 7 replies
 * 2 participants
 * Last reply from: [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/undefined-property-wp_querypost/#post-3734185)
 * Status: resolved