Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

“Comment” object must be nested inside a “CreativeWork” object

  • I noticed GP injects a standard schema of CreativeWork. Since Google is now detecting Forum schema in Google Search Console, I am noticing this warning.

    “Comment” object must be nested inside a “CreativeWork” object

    Any ideas on how to resolve this? Perhaps this can be looked at for future releases?

  • Hi Ian,

    For reference, can you share a link to where we can see this issue on your site?

    Also, does Google Search Console share more information about – “Comment” object must be nested inside a “CreativeWork” object? If it does, can you share it?

  • It’s actually inside Google Search Console. Google has added new scheam that GSC can recognize looks like Forum is one of them that is showing now. If you log in to Google Search Console, it will be under the Overview page in the Enhancements section. It’s the same section as the Breadcrumbs schema.

    I see lots of Green URLs and I also see yellow URLs for:

    “Comment” object must be nested inside a “CreativeWork” object
    and
    Missing field “url” (in “author”)

    Maybe this can be updated in GP? Not sure if that is the plan.

    Thanks!

    Ian

  • I see. I’ll forward this to Tom just in case he has an insight.

    But, can you make a suggestion about this here?: https://feedback.generatepress.com/

  • Thanks Fernando. Done!

  • You’re welcome!

  • I have the same problem too 🙂

  • Hi there,

    we will review and update the themes schema requirements where applicable.
    to cover:

    1. creativeWork we can add our schema function to the comments-area container.

    2. Missing field “url” (in “author”) we can include this in the the link contained within the cite itemProp=name.
    However if a user does not or cannot leave a URL when submitting a comment, then there will be no markup for this item.

    For now, there is no immediate need to change anything.
    The markup and schema for these items is perfectly valid.
    These are currently suggested improvements from google, and their absence has no impact on your search results rich snippets.

    UPDATE:

    For the Missing field “url” (in “author”) and users allow URLs to be added. This PHP snippet will add the missing prop for you for now:

    
    function custom_comment_author_link($comment_author_link, $comment_author, $comment_id) {
        $author_url = get_comment_author_url($comment_id);
    
        if (!empty($author_url)) {
            // Add itemprop="url" to the <a> tag
            $comment_author_link = str_replace('<a', '<a itemprop="url"', $comment_author_link);
        }
        return $comment_author_link;
    }
    
    add_filter('get_comment_author_link', 'custom_comment_author_link', 10, 3);
    
  • Hi David,

    Thanks for your reply. Looks like GP will take care of #1 in a future release? Awesome.

    Let me test the code for #2. We are hiding the comment URL to block spam comments. Do you think the snippet you provided may potentially conflict?

  • We will address both issues in a future release.

    RE: #2 –
    If you have removed the URL field from the Comments form
    Then there is nowhere in the comments HTML for the itemprop="url" to be added.
    So that snippet won’t do anything.
    And you should ignore this improvement notice from Google as you can’t add something thats not there

    Some more useful info on the matter here:
    https://support.google.com/webmasters/thread/245921519?hl=en&msgid=246028957

  • Thanks David! Glad these items can be taken care of in future releases! It’s a balance I think. The recent Google HCU and Core updates have turned SERPs upside down. With Reddit being pushed up in the SERPs and now the Forum schema being one that GSC can monitor, I wonder if getting all of these minor items resolved may help with SEO in the long run. No one will know except Google but I assume every little bit counts I suppose. Thanks!

  • Whats odd is that they flag the absence of the itemprop="url" when there is no link in the comment author.
    Is it possible to see a post that got flagged by google ?
    Just want to make sure there isn’t something else amiss ( aside from Googles logic )

  • I also got the same issues. https://postimg.cc/S2QGD2hg

  • Hi there,

    See my reply here:

    https://generate.support/topic/comment-object-must-be-nested-inside-a-creativework-object-2/#post-67192

    And particularly:

    For now, there is no immediate need to change anything.
    The markup and schema for these items is perfectly valid.
    These are currently suggested improvements from google, and their absence has no impact on your search results rich snippets.

  • I apologize for revisiting this topic, but since more than 2 months have passed and I have just received the alerts below from Google Search Console, I would like to know if the guidance remains the same, that is, if I can ignore this without worrying about the impact on search results (which have already been a disaster since the HCU in September ’23, anyway).

    “Comment” object must be nested inside a “CreativeWork” object
    and
    Missing field “url” (in “author”)

  • Hi there,

    nothing has changed, you can keep on ignoring those alerts from Google.

    We aim to make the necessary changes in the next main release of the theme.

Viewing 16 posts - 1 through 16 (of 20 total)
  • You must be logged in to reply to this topic.