There are many solutions for that..
1. .htaccess rules
You can put some redirect rules in your .htaccess file:
RewriteRule ^(.*)\-staff/$ /staff/? [L,R=301]
// some other rules
2. Using WordPress hooks
function my_redirect_function() {
global $wp;
if ( preg_match( '@staff/?$@', $wp->request ) ) {
wp_redirect( get_post_type_archive_link( 'staff' ) );
die;
}
// ... put other rules in here
}
add_action( 'template_redirect', 'my_redirect_function' );
3. Using Redirection plugin
You can use that plugin and define custom redirects based on regular expressions.
Related Posts:
- Redirect after deleting post and keep track of pagination
- Unable to get wp_redirect() working after adding a CPT via the front end
- Multiple portfolios and single item in two of them (ideas?)
- Redirect 404 page with ID in slug to associated page with same ID in slug
- Why does not this wp_redirect work in is_single()?
- Custom URL redirect in WP
- How to access the thank you page from the single post?
- Redirect User From Registration Page To CPT (profile page) with custom url
- Redirect to URL if x number of days passed
- Redirect users in first login to a dynamic link
- wp_redirect to file:// location results in blank page/cannot be displayed page
- Redirect drafted post of custom post type to URL?
- Automatically sorting custom post type admin area by a custom field
- How make get_next_post() return first post when viewing last one
- Get all authors with at least one post of ‘custom post type’
- Exclude from search all custom posts which are NOT in a taxonomy term
- Remove tabs from media uploader for a CPT
- Remove unwanted part of permalink custom structure from CPT url?
- Changing a custom post type “has_archive” after registered
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- wp_insert_post custom taxonomy
- dynamically update permalink and title with the values of custom fileds
- ascending order custom post type
- New WP_query in template not working with CPT+category on some pages
- Parent page for CPT
- Post Link Filter Help [closed]
- Custom Post Type not appearing in website search
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Count posts with specific term_meta
- Custom search for custom post meta with pre_get_posts interferes with WP search
- Need to display same custom post type on 2 different singles templates
- submenu item edit a specific post
- get_posts of Custom Post Type AND Custom Taxonomy
- Tag page with Custom Post Types not returning any posts
- With two custom post types, how to make one a child of the other in the admin menu?
- Get parent categories of custom post type
- Advanced or not so advanced pre_get_posts query
- Querying both pages and posts
- WordPress sort search results by custom order
- Pagination issue on category.php using custom post type query
- How to change permalink to include custom post type
- Listing all term items alphabetically / sorting loop
- save_post custom post type ? $_POST not working?
- Change the Custom Taxonomy URL Slug pattern
- Single page not working for custom post type
- Load Next WordPress Posts With AJAX?
- Add a custom meta box for client to order CPT posts how they want
- Add categories to a page with out using Custom Post Types
- Gravity forms multiple posts generated by one form [closed]
- Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?
- CPT Columns doesn’t show categories
- Role capabilities issue
- Custom Post Type “MUST NOT” be able to search via URL
- Custom taxonomy template list not working (404)
- Query for post and costom post_type in same category filtered by meta for post_type
- How to add and display custom content that is not a post
- List latest post out of 2 custom post types
- Adding custom post formatting options in custom post types
- Calling related posts to a custom post type, taxonomy & Tag id
- How to get custom post type title, excerpt, thumbnail and permalink by post ID?
- Adding Page Ordering to a Custom Page Type
- How to properly use Categories with Custom Post Types
- Better in the long run to use post date or custom taxonomy to sort/separate posts by year?
- Get post-meta value of all custom-posts – lowest to highest year-count?
- One Custom Post Type two different Templates
- Custom Post Type Query W/Category Dropdown
- On click some element i want to use some template
- Pin posts to top of custom loop
- Remove custom taxonamy slug with pagination
- wp delete duplicate entries of custom post types every 15 minutes
- How do I link to a dynamic ACF button from a Custom Post type?
- Hook create / update post
- Show Post columns to specific users on condition
- Change picture attachment meta of all occurrences of a picture
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- How to use costum database table for custom post type
- connect users to Custom post types
- Populate custom post type/custom fields from an external database
- Making my custom column sortable
- date_query won’t accept day parameter, but will accept month and year for a custom post
- the_permalink() leads back to homepage
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- 404 error Custom search results page for custom post types with friendly URL
- Prevent repetitive terms in get_the_term_list
- Generate custom RSS from a plugin
- Show taxonomies from specific CPT
- Custom metabox value not saving
- Category / Custom Post Type permalink issue
- is_singular won’t call my functions?
- loop through custom post-type with two meta_keys
- Generating custom URL before post is published
- How do i make a listing page of custom post type?
- How to add post type in masonry posts elementory widget
- How to exclude certain portfolios from a loop
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- Calling custom taxonomies
- Is it possible to use a post name in a custom post slug?
- How do I add the “orange counter” next to a Custom Post Type?