Schema for Enhanced Categories

  • We’re using the Enhanced Categories plugin (extends a Category and allows it to function as a Page).

    The editor is totally the same as a Page and all the RankMath options are there, too. All except for the Rich Snippets tab beneath the editor.

    I’m interested in these appearing as a Service, but they currently all show as CollectionPage. Is there a way to fix that up? Possibly with a hook or filter?

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

    Thank you for contacting Rank Math today.

    Yes this is possible, you can make use of the below filter in your theme to target a particular category page and remove the CollectionPage Schema:

    /**
     * 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);

    You can then add some some custom Json-ld data to this page by making use of this filter:

    /**
     * Collect data to output in JSON-LD.
     *
     * @param array  $unsigned An array of data to output in json-ld.
     * @param JsonLD $unsigned JsonLD instance.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 10, 2);

    Let me know if you need additional help on this. Thank you.

    ​​​​​​

    That’s perfect, thanks!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Schema for Enhanced Categories’ is closed to new replies.