{"id":8547,"date":"2021-05-16T19:32:46","date_gmt":"2021-05-16T17:32:46","guid":{"rendered":"https:\/\/www.welaunch.io\/en\/my-tickets\/ticket\/disable-single-store-pages\/"},"modified":"2021-08-11T09:26:32","modified_gmt":"2021-08-11T07:26:32","slug":"disable-single-store-pages","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/disable-single-store-pages\/","title":{"rendered":"Disable single store pages in WordPress"},"content":{"rendered":"<p>Starting from version 2.0.18 you can turn off single store pages in WordPress directly in plugin settings.<\/p>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_107885703\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"519\" src=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-1024x521.png\" class=\"attachment-large size-large\" alt=\"disable single store page\" srcset=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-1024x521.png 1024w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-247x126.png 247w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-510x260.png 510w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-300x153.png 300w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-768x391.png 768w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page-1536x782.png 1536w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/08\/disable-single-store-page.png 1976w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style>\n#image_107885703 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n<p>Maybe you are wondering if there is an option to disable the single store pages? For example in some cases your stores listing are distributors, not your own stores. So, ideally, you only want them to show up in search results and for people to get directions, but not for them to be clickable and to have a dedicated page for each one of them.In this case place the following code into your functions.php file of your child theme:<\/p>\n<pre>&lt;?php <br \/>add_action( 'template_redirect', 'we_redirect_single_stores_pages' );<br \/>function we_redirect_single_stores_pages() { <br \/>if ( is_singular( 'stores' ) ) {<br \/>wp_redirect( home_url(), 301 );<br \/>exit;<br \/>}<br \/>}<br \/>?&gt;<\/pre>\n<p>This will simply redirect all single store pages to your home page. Of course you can also change the URL by replacing home_url().<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-8547","faq","type-faq","status-publish","hentry","faq_topics-store-locator","faq_topics-store-locator-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=8547"}],"version-history":[{"count":4,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8547\/revisions"}],"predecessor-version":[{"id":9208,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8547\/revisions\/9208"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=8547"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=8547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}