{"id":2467,"date":"2026-10-20T08:33:27","date_gmt":"2026-10-20T07:33:27","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/change-text-gd-notifications\/"},"modified":"2026-10-20T08:55:28","modified_gmt":"2026-10-20T07:55:28","slug":"change-text-gd-notifications","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/change-text-gd-notifications\/","title":{"rendered":"How to change the text shown by GD Notifications"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The GD &gt; Notifications block (<code>&#091;gd_notifications&#093;<\/code>) has no text of its own. It shows messages that GeoDirectory and its add-ons send to it, for example &#8220;This business appears to have closed down and may be removed soon.&#8221; on a listing marked as closed, or the notice Pricing Manager shows on an expired listing. CSS <code>content<\/code> rules cannot replace that text, but you can change it in two ways.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Change the wording with a translation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every message is a translatable string, so you can change it with a translation even if your site is in English. Follow <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/translations\/how-to-change-just-one-language-string\/\">How to change just one language string<\/a>, or see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-translate-or-localize-geodirectory\/\">How to translate or localize GeoDirectory<\/a> for a full translation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Change a message with a code snippet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Notifications pass through the <code>geodir_notifications<\/code> filter as an array. Each message has a key, a <code>type<\/code> (error, warning, success or info) and a <code>note<\/code> with the text. This snippet replaces the text of the closed down message:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_filter( &#039;geodir_notifications&#039;, &#039;my_gd_notification_text&#039;, 1000 );\nfunction my_gd_notification_text( $notifications ) {\n\tif ( isset( $notifications&#091;&#039;post_is_closed&#039;&#093; ) ) {\n\t\t$notifications&#091;&#039;post_is_closed&#039;&#093;&#091;&#039;note&#039;&#093; = &#039;This business has now closed.&#039;;\n\t}\n\n\treturn $notifications;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The key for the temporarily closed message is <code>post_is_temp_closed<\/code>. To find the key of any other message, temporarily add <code>error_log( print_r( $notifications, true ) );<\/code> inside the function and check your debug log.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add snippets with the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a> rather than editing theme files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The GD &gt; Notifications block (&#091;gd_notifications&#093;) has no text of its own. It shows messages that GeoDirectory and its add-ons send to it, for example &#8220;This business appears to have closed down and may be removed soon.&#8221; on a listing marked as closed, or the notice Pricing Manager shows on an expired listing. CSS content [&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-2467","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\/2467","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=2467"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2467\/revisions"}],"predecessor-version":[{"id":2724,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2467\/revisions\/2724"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2467"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2467"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}