{"id":953,"date":"2025-03-24T14:28:07","date_gmt":"2025-03-24T14:28:07","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-change-default-text-for-near-me-search\/"},"modified":"2025-07-24T14:55:39","modified_gmt":"2025-07-24T13:55:39","slug":"how-to-change-default-text-for-near-me-search","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/how-to-change-default-text-for-near-me-search\/","title":{"rendered":"How to Change Default Text for Near Me Search?"},"content":{"rendered":"\n<p>When using Location Manager, you can add a <strong>Near Me <\/strong>search feature to your search bar, that shows locations that are <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/gd-near-me-button\/\">in proximity to user&#8217;s location<\/a>.\u00a0<\/p>\n\n\n\n<p>You can replace the default &#8220;In:&#8221; text shown in search results with &#8220;Near:&#8221; using the following code snippet:\u00a0<\/p>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-info mb-3\" role=\"alert\"><span class=\"fas fa-info-circle me-2\"><\/span><span class=\"flex-grow-1\">We recommend using the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets<\/a> plugin to add snippets to your site.<\/span><\/div>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">function gd_snippet_search_disable_in_location( $script ) {\n\t$script = str_replace( &#039;gdlm_ls_city_suggestion();&#039;, &#039; gdlmls_doing_search = 0;gdlm_ls_maybe_suggest_more();&#039;, $script );\n\t$script = str_replace( &#039;function gdlm_ls_current_location_suggestion() {&#039;, &#039;function gdlm_ls_current_location_suggestion() {return;&#039;, $script );\n\t$script = str_replace( array( &#039;gdlm_ls_region_suggestion();&#039;, &#039;gdlm_ls_country_suggestion();&#039;, &#039;gdlm_ls_neighbourhood_suggestion();&#039; ), &#039;&#039;, $script );\n\n\treturn $script;\n}\nadd_filter( &#039;geodir_location_switcher_footer_script&#039;, &#039;gd_snippet_search_disable_in_location&#039;, 10, 1 );<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When using Location Manager, you can add a Near Me search feature to your search bar, that shows locations that are in proximity to user&#8217;s location.\u00a0 You can replace the default &#8220;In:&#8221; text shown in search results with &#8220;Near:&#8221; using the following code snippet:\u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[566,816],"article\/categories":[211,433],"class_list":["post-953","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-advanced-search","gd_place_tags-near-me","gd_placecategory-tips-tricks-more","gd_placecategory-code-snippets"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/953","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=953"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/953\/revisions"}],"predecessor-version":[{"id":2047,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/953\/revisions\/2047"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=953"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=953"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}