Type CollectionPage customization

  • Hello.

    Is it possible to customize schema Type CollectionPage used for categories? Is there hook support for this?

    example:

    @type
    CollectionPage
    @id test.com
    url test.com
    inLanguage tr
    name ayhan
    description test
    isPartOf
    @type
    WebSite
    @id test.com
    url test.com
    name ayhan
    publisher
    @type
    Person
    @type
    Organization
    @id
    test.com
    url
    test.com
    name
    ayhan
    sameAs
    https://www.facebook.com
    sameAs
    https://twitter.com
    image
    @type
    ImageObject
    @id
    test.com
    url
    https://secure.gravatar.com
    width
    96
    height
    96
    caption
    ayhan
    logo
    @type
    ImageObject
    @id
    test.com
    url
    https://secure.gravatar.com
    width
    96
    height
    96
    caption
    ayhan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I am afraid that we do not have a filter to customize this data but you can disable the collection page schema and then generate your own custom schema code by using the following filter:

    /**
     * Allow developers to remove snippet data from Taxonomies.
     *
     * @param bool $unsigned Default: false
     * @param string $unsigned Taxonomy Name
     */
    add_filter( 'rank_math/snippet/remove_taxonomy_data', function( $value, $taxonomy ) {
    	return $value; // true or false
    }, 10, 2);

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hi.

    I will target the home page. in this case, what path should I follow for the custom snippet?
    I want to use this snippet for homepage. @type WebPage

    Hello,

    Thank you for contacting Rank Math today.

    I am afraid that your question is not very clear, could you please share more info on what you mean by path?
    You can use the condition is_home() or is_front_page() to check if the current page is the homepage/blog page.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Type CollectionPage customization’ is closed to new replies.