{"id":2294,"date":"2026-10-20T08:30:40","date_gmt":"2026-10-20T07:30:40","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/shortcodes-in-custom-fields\/"},"modified":"2026-10-20T08:39:39","modified_gmt":"2026-10-20T07:39:39","slug":"shortcodes-in-custom-fields","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/shortcodes-in-custom-fields\/","title":{"rendered":"Can I add shortcodes to a GeoDirectory custom field?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">GeoDirectory has no &#8220;Shortcode&#8221; custom field type, but there are two ways to show shortcodes on listings. Which one you use depends on whether the shortcode is the same for every listing or different on each.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The same shortcode on every listing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the Tabs builder. In Places &gt; Settings &gt; Tabs there is a Shortcode item: add it to your tabs, name it and enter the shortcode. It then shows on the details page of every listing in that post type. GeoDirectory&#8217;s own shortcodes, such as <code>&#091;gd_post_meta&#093;<\/code>, read the listing being viewed, so they work well here. See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-use-the-tabs-builder-in-geodirectory\/\">How to Use the Tabs Builder in GeoDirectory<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also add any shortcode or block directly to your Details page template, which you find in GeoDirectory &gt; Settings &gt; General &gt; Pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A different shortcode on each listing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add an HTML or Textarea field in Places &gt; Settings &gt; Custom Fields. GeoDirectory runs shortcodes inside these fields when it displays them, so each listing can hold its own shortcode, such as a form or gallery with a different ID per listing. The listing description works the same way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Shortcodes entered by other users are removed when a listing is saved, unless their user role is allowed to use them. Administrators always can. To allow other roles, go to GeoDirectory &gt; Settings &gt; General and add them to Allow shortcodes in description to. That setting applies to these fields as well as the description.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To control where the field appears, use its Show in extra output location setting, or place it in a template with <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-post-meta\/\">GD &gt; Post Meta<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory has no &#8220;Shortcode&#8221; custom field type, but there are two ways to show shortcodes on listings. Which one you use depends on whether the shortcode is the same for every listing or different on each. The same shortcode on every listing Use the Tabs builder. In Places &gt; Settings &gt; Tabs there is a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[421,213],"class_list":["post-2294","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-core-features","gd_placecategory-extensions-features"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2294","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=2294"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2294\/revisions"}],"predecessor-version":[{"id":2605,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2294\/revisions\/2605"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2294"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2294"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}