Support » Plugin: Simple Staff List » Prevent use of /staff-members/ pages

  • Resolved bluesix

    (@bluesix)


    We’re using shortcodes to display our staff and don’t require the /staff-members/ and associated profile pages. However it’s getting indexed by Google and the format of that page doesn’t match our site. Is there a way to disable the /staff-members/ archive?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brett Shumaker

    (@brettshumaker)

    Hi @bluesix

    Currently, there’s not a way to turn these off by default, but I’ll add a filter to allow that in the next version.

    To get around this, for now, you’ll need to do a template redirect when a request comes into a single Staff Member page and send the user to another page. Something like this added to your theme’s functions.php file should work:


    function sslp_support_redirect_single_staff_members_to_home() {
    $queried_post_type = get_query_var('post_type');
    if ( is_single() && 'staff-member' == $queried_post_type ) {
    wp_redirect( home_url(), 301 );
    exit;
    }
    }
    add_action( 'template_redirect', 'sslp_support_redirect_single_staff_members_to_home' );

    Thanks!

    Great, thanks Brett!

    (I cheated and used robots.txt to stop it getting indexed ;))

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.