• Resolved Divvy

    (@divvy)


    Hello,

    Maybe someone can help me.
    Today I notice that my frontpage schema was showing as WebPage @type, so I edit my front page from WebPage to CollectionPage. Everything seems correct, the problem is that is showing both now.

    Please take a look:

    <script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":["WebPage","CollectionPage"]

    How can I show the CollectionPage only?

    Thank you, and keep the excellent work!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @divvy

    Thanks for the kind words & for reaching out about your site schema. The Web Page page type is for a normal web page and it’s our default setting for Pages while Collection Page page type is for a page which contains a list of other pages; such as a post archive or blog overview.

    Can you confirm what you chose in WordPress > Settings > Reading > Your homepage displays?

    Thread Starter Divvy

    (@divvy)

    Hello @maybellyne

    It makes sense what you said. After I checked the WordPress > Settings > Reading > Your homepage displays I noticed that I have two pages in there, the homepage and the posts page to show the latest posts.

    Homepage has the Collection Page schema
    And the Latest Posts page has the Web Page

    Probably it’s why is showing both types, correct?
    But if I remove the posts page from settings, it still shows both types, I need to show only the Collection Page on Homepage. Is it possible?

    I think it is because I have found some sites using the schema from yoast and it is only showing the type Collection Page.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @divvy

    Thanks for following up. I assume that when you first checked WordPress > Settings > Reading > Your homepage displays, it was set to A static page. This means you had a page set as your homepage and another as your posts page. If this is correct, the homepage should have the web page schema, while the posts page should have the collection page schema.

    To clarify, currently, what do you have the homepage set to display? Is it Your latest posts, or a static page. Please provide us with screenshots that highlight the issue you are experiencing. You can use any image-sharing service like https://pasteboard.co/, https://snag.gy/, https://imgur.com/, https://snipboard.io/, or even upload the screenshot to your website. Once you upload it to an image-sharing service, please share the link to the image here.

    • This reply was modified 3 years, 4 months ago by Maybellyne.
    Thread Starter Divvy

    (@divvy)

    Hello @maybellyne

    My Settings > Reading > Your homepage displays: https://prnt.sc/BHt6NPxibmyH
    Homepage: https://prnt.sc/UcLdalSwNJm0
    Latest Updates: https://prnt.sc/IQmrWHPVeJWZ

    This is showing two types on the homepage:
    WebPage”,”CollectionPage

    Is it possible to show only the type CollectionPage on the homepage?
    I tried to remove the Latest Updates from the Posts page but still shows the two types. I also tried changing the schema of the Latest Updates to CollectionPage so can have the same type on both pages, but still shows two types. Doesn’t make sense.

    Thanks



    Plugin Support Michael Tiña

    (@mikes41720)

    Hi @divvy

    A CollectionPage is a type of WebPage, so we display it in an array. If you’d like to make any modifications to the default Yoast SEO schema output, you can refer to our Schema API for more information.

    Please note though that we won’t be able to help provide feedback on what sort of custom code changes you’ll need to make, but feel free to make modifications as you see fit to your site – https://developer.yoast.com/features/schema/api/

    Thread Starter Divvy

    (@divvy)

    Hello @mikes41720

    Thank you for your response.
    I see many sites using Yoast that just shows one type instead of two like mine.

    For example, take a look at this site:
    https://toppornsites.com (NSFW CONTENT)

    Their source code:
    <script type=”application/ld+json” class=”yoast-schema-graph”>{“@context”:”https://schema.org&#8221;,”@graph”:[{“@type”:”CollectionPage“,”@id”:”https://toppornsites.com

    My source code:
    <script type=”application/ld+json” class=”yoast-schema-graph”>{“@context”:”https://schema.org&#8221;,”@graph”:[{“@type”:[“WebPage”,”CollectionPage“],”@id”:”https://domain.com

    I just need to show one as well.

    • This reply was modified 3 years, 4 months ago by Divvy.
    • This reply was modified 3 years, 4 months ago by Divvy.
    • This reply was modified 3 years, 4 months ago by Divvy.
    Plugin Support Maybellyne

    (@maybellyne)

    Hello @divvy

    You have both WebPage and CollectionPage page type because you have switched around the schema. Both are now stored as an array. Also, CollectionPage is a subtype of WebPage. There should be no cause for concern unless there are warnings. For the example site you shared, they definitely stuck with the default and didn’t change things.

    We also mentioned that by overriding the defaults, you may alter your schema markup in ways that don’t make sense or that are incomplete. And we are constantly improving the schema implementation in our plugins.

    Thread Starter Divvy

    (@divvy)

    Hi @maybellyne

    But if I stay with the default it shows as WebPage.
    I changed to CollectionPage because is what I want to use like the site above that is using the Yoast plugin as well.

    Settings: https://prnt.sc/j1np8IlS8yIz
    Homepage: https://prnt.sc/fQow3ybZBPsO

    I changed it now like this, is not supposed to appear just one type now? 🙂

    Plugin Support Michael Tiña

    (@mikes41720)

    Hi,

    We know that a WebPage can be transformed into a CollectionPage when it meets certain criteria, such as default post category pages – https://developer.yoast.com/features/schema/pieces/webpage/#transformations

    However, it doesn’t mean that if you have a static homepage and you set the schema type to ‘CollectionPage’, it will output it as such. It won’t cause any issues or errors when validating the schema in the schema.org validator or Rich Results Test, as it is valid to place it in an array as such.

    Again, if you want to set custom schema, and if it isn’t outputting as you’d expect with the default settings in the Yoast SEO plugin schema graph (such as really enforcing that it outputs only as ‘CollectionPage’ and not an array with WebPage), you can modify it through custom code in the Schema API.

    Plugin Support Maybellyne

    (@maybellyne)

    This thread was marked resolved due to a lack of activity, but you’re always welcome to re-open the topic. Please read this post before opening a new request.

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

The topic ‘Schema with two types’ is closed to new replies.