Widgets without Redundant URL's

Hi, I’m trying my best to cut down on the amount of redundant URL’s for SEO purposes but every testimonial, service, client etc. creates its own separate URL.

I want to be able to create them because the frontpage widgets look fantastic, but I have no desire to have more pages for no reason. Is there a way for us to use these widgets without creating extra pages like this?

Hello there,

To restrict direct access to the registered custom post types of Sydney Toolbox plugin, try adding the below function to your child theme’s functions.php file. Or you can use a functionality plugin like Code Snippets without running a child theme.

    function sydney_child_modify_cpt( $args, $post_type ) {

      $custom_args = array();
      $custom_args['public']              = false;
      $custom_args['has_archive']         = false;
      $custom_args['publicaly_queryable'] = false;
      $custom_args['query_var']           = false;

      switch ($post_type) {
        case 'services':        // Services
        case 'employees':       // Employees
        case 'testimonials':    // Testimonials
        case 'clients':         // Clients
        case 'projects':        // Projects
          $args = array_merge( $args, $custom_args );
          break;
      }

      return $args;

    }
    add_filter( 'register_post_type_args', 'sydney_child_modify_cpt', 10, 2 );

The links might still appear on Google Search due to cached queries. Thus you’d need to manually remove them from Google. For links that might be found by visitors will be returned not found page. You might want redirect them to home page with this plugin.

Regards,
Kharis