Title: Undefined property: stdClass::$post_type
Last modified: September 1, 2025

---

# Undefined property: stdClass::$post_type

 *  Resolved [Daniele Scasciafratte](https://wordpress.org/support/users/mte90/)
 * (@mte90)
 * [9 months, 1 week ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/)
 * Fix at file seo-by-rank-math/includes/replace-variables/class-post-variables.
   php at line 303:
 *     ```
       if ( empty( $object ) || empty( $object->ID ) || !isset($object->post_type) ) {
       ```
   
 * Same file at line 328 the same line above.

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

 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [9 months, 1 week ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18625928)
 * Hello [@mte90](https://wordpress.org/support/users/mte90/),
   Thank you for contacting
   Rank Math support.We have shared the solution with the development team for internal
   discussion. They will check and include it in an upcoming update. You can keep
   an eye on our changelog to get notified about the latest features and updates:
   [https://rankmath.com/changelog/](https://rankmath.com/changelog/)Please do not
   hesitate to let us know if you need our assistance with anything else.
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18644571)
 * Hello [@mte90](https://wordpress.org/support/users/mte90/),
 * Can you please share more details, including how to replicate the issue and trigger
   the error/warning, so our development team can investigate this further?
 * Looking forward to hearing back from you.
 *  Thread Starter [Daniele Scasciafratte](https://wordpress.org/support/users/mte90/)
 * (@mte90)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18644802)
 * I don’t know how it is happening, I just got tons of those in my error log and
   this easy fix resolved the issue for me.
    For me that code is used probably to
   generate page description but in this case as dodoes’find the post type is happening
   in pages where there is no post type.
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18647810)
 * Hello [@mte90](https://wordpress.org/support/users/mte90/),
 * Thank you for sharing the details. The developers are checking this internally
   and we will let you know once there is an update.
 * Please do not hesitate to let us know if you need our assistance with anything
   else in the meantime.
 *  Thread Starter [Daniele Scasciafratte](https://wordpress.org/support/users/mte90/)
 * (@mte90)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18650866)
 * I have found another error
 * Warning: Attempt to read property “ID” on null in /home/clients/0310c843a1e585ae6463b6df3093460e/
   sites/wp-content/plugins/seo-by-rank-math-pro/includes/modules/schema/class-display-
   conditions.php on line 171 in the tag editing.
 * I changed the line:
 *     ```
       if ( ( is_singular() || is_admin() ) && isset( $all['singulars'] ) && get_post_type() !== false ) {
       ```
   
 * The code is wrong as it is executed also in taxonomies and not only in post type
   editing.
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18652769)
 * Hello [@mte90](https://wordpress.org/support/users/mte90/),
 * Our developers want to check this further on your site since we can’t replicate
   the issue on our end. Can you please email our development team at [support@rankmath.com](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/support@rankmath.com?output_format=md)
   so they can investigate this further?
 * Looking forward to helping you.

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

The topic ‘Undefined property: stdClass::$post_type’ is closed to new replies.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * Last activity: [8 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-property-stdclasspost_type-3/#post-18652769)
 * Status: resolved