Support » Plugin: Yoast Duplicate Post » Trying to get property of non-object

  • Resolved Kevin Pfeifer


    Dear Support-Team!

    I recently checked my website’s debug.log and have seen following entries:

    PHP Notice: Trying to get property of non-object in <my-docroot>/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 149

    PHP Notice: Trying to get property of non-object in <my-docroot>/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 123

    Both if queries expect, that the $post variable has a property “post_type”.

    But what if it hasn’t => if the post-id given in $_GET is no valid?

    Please add a check to these 2 if queries so there is no debug.log output.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • thehowarde


    I also get this error. I am using PHP 7.2 and I believe your error is the function


    The error only occurs on post types where duplicate post is NOT enabled.

    • This reply was modified 2 years ago by thehowarde.

    I also get this error generated from plugin file /duplicate-post/duplicate-post-common.php

    These notices can be resolved by changing the following condition in the above plugin file

    Before :
    if ( is_admin() && isset( $_GET['post'] ))

    After :
    if ( is_admin() && isset( $_GET['post'] ) && ! empty( $_GET['post'] ))

    I get the same issue when using Contact Form 7. I get the warning when entering the CF7 menus. Please add this check to resolve the issue in the next version of the plugin.

    Still this error.
    I have used the solution present in this support ticket:

    It works!

    But it would be nice that the next update would bring this error to an end, since so many people have reported it and found how to correct this. Maybe the author could implement one of the solutions already found with next next update 🙂


    Same error here, it appears in Contact Form 7 backend page.

    Plugin Author Enrico Battocchi


    Hi @tamara-it @magaworks @jordanwebdev @vinod-dalvi @thehowarde,
    version 3.2.3 fixes the issue. Sorry for the delay…



    i have some error in my website please help me how to remove this error “Trying to get property ‘term_id’ of non-object in /home/vamsum/public_html/wp-content/themes/coi/template-parts/shop-top-categories.php on line 76”

    Hi @vickipeterson,

    the error you posted has the same error message, but its origin has nothing to do with this plugin.

    Your problem resides in your used theme “coi”.

    Please contact the support forum of your used theme.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Trying to get property of non-object’ is closed to new replies.