{"id":2483,"date":"2026-10-20T08:34:08","date_gmt":"2026-10-20T07:34:08","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/add-schema-type-to-categories\/"},"modified":"2026-10-20T08:38:59","modified_gmt":"2026-10-20T07:38:59","slug":"add-schema-type-to-categories","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/add-schema-type-to-categories\/","title":{"rendered":"How to add a new schema type for GeoDirectory categories"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Each GeoDirectory category has a Schema Type setting. The structured data on a listing&#8217;s page uses the schema type of the listing&#8217;s default category. If that category has none, it uses LocalBusiness (Event for events).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set the schema type of a category<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to Places &gt; Categories and edit the category.<\/li>\n\n\n\n<li>Choose a type in the Schema Type dropdown.<\/li>\n\n\n\n<li>Update the category.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The dropdown already has a long list of schema.org types, grouped under their parent type. Look through it before adding your own. For example, MusicGroup sits under PerformingGroup, and Person is near the bottom.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add a type that isn&#8217;t in the list<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>geodir_cat_schemas<\/code> filter. The array key is the schema.org type name and the value is the label shown in the dropdown:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_filter( &#039;geodir_cat_schemas&#039;, function( $schemas ) {\n\t$schemas&#091;&#039;Product&#039;&#093; = &#039;Product&#039;;\n\n\treturn $schemas;\n} );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the snippet with the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a>, then edit your category and the new type will be in the dropdown.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Only add real schema.org type names. GeoDirectory outputs the same listing details whichever type you pick, so test a listing page in Google&#8217;s Rich Results Test after you change it. Developers who need to change the full output can use the <code>geodir_details_schema<\/code> filter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why the default category matters is explained in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/what-is-the-default-category-field-for\/\">what is the default category field for<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Each GeoDirectory category has a Schema Type setting. The structured data on a listing&#8217;s page uses the schema type of the listing&#8217;s default category. If that category has none, it uses LocalBusiness (Event for events). Set the schema type of a category The dropdown already has a long list of schema.org types, grouped under their [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,433],"class_list":["post-2483","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-code-snippets"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2483"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2483\/revisions"}],"predecessor-version":[{"id":2561,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2483\/revisions\/2561"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2483"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2483"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}