Starting from version 2.0.18 you can turn off single store pages in WordPress directly in plugin settings.
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:
<?php
add_action( 'template_redirect', 'we_redirect_single_stores_pages' );
function we_redirect_single_stores_pages() {
if ( is_singular( 'stores' ) ) {
wp_redirect( home_url(), 301 );
exit;
}
}
?>
This will simply redirect all single store pages to your home page. Of course you can also change the URL by replacing home_url().
Hi, the code snippet appears to be missing on this FAQ. What is the code snippet required in the functions.php file?
From version 2.0.18 you can disable single store pages within plugin settings. We will update the FAQ now 🙂