As stated by Milo it looks like it a duplicate of [How to disable the single view for a custom post type?]
<?php
add_action( 'template_redirect', 'subscription_redirect_post' );
function subscription_redirect_post() {
$queried_post_type = get_query_var('post_type');
if ( is_single() && 'subscription' == $queried_post_type ) {
wp_redirect( pricingpageURL, 301 );
exit;
}
}
?>
Just swap our pricingpageURL with the pricing page URL value of your choice. Hope this helps.
Related Posts:
- How do I redirect all 404 errors of a specific post type to another URL?
- Custom Post Type without an archive page
- Redirect 404 page with ID in slug to associated page with same ID in slug
- Create short URL with auto 301 redirect
- redirect after submiting post for review
- Custom 404 redirect for a luddite
- Display a query with multiple post types and same relationship on a single page
- WordPress Custom Post Types with a page as a parent?
- WordPress Custom Post Type is Matching on Partial Slug
- Custom Post Types Not acknowledged for date.php template
- Limit Authors to their Own Posts on front-end excluding admins
- Redirect to post with only post ID in the URL vs post_type/post ID
- Display children and grandchildren of a custom post type
- is_page_template not working as expected
- Conditional to modify query results
- How to redirect wp-admin/index.php to a custom post type?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Return array of categories to php function for current post
- Create a random unique 6 digit number as custom field for custom post type
- Loading all files within a directory
- Using several custom fields as custom post title
- Get rewrite slug of custom post type in template
- Adding custom tables to WordPress
- Return the thumbnail meta data for getter and setter
- Custom Post-Type not in admin menu
- Page vs Custom Post Types Differences/Issues
- How to make a field appear only if a post meta field has a defined value?
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Set URL link to featured image of custom post type
- On update or create post redirect to current post position in list
- How do I add a custom screen for a custom post type to be called from custom post row action?
- How to display custom WP menus?
- Can slugs from posts and custom post types conflict?
- Problems wp_insert_post and save_posts filter
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- Cant get paginations on single.php to work with my custom post types
- Custom URL redirect in WP
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- WP_Query Custom Post Type if Category ID Equals
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- Control content before and after custom post type loop
- How to use a variable as a function name?
- Redirect to first child on Custom Post Type (without template)
- Different options per post type in WP_Query
- How do I create a new post upon registration with the users first and last name as title
- Query entries from custom post type in an ACF flexible content field
- Creating a non-hierarchical Taxonomy that behaves like categories
- Shortcode is displaying the content on top of the page [duplicate]
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- How to set the mainpage of a custom post type?
- custom post type by author – wp job manager
- Using Wp_Query, Json to add Highcharts series data
- Template code to split a post and print a custom field?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Let users upload image(s) to the post from front end
- Foreach loop returning more than one item when querying taxonomy
- Using page title as a link to term archive
- How to display custom post type only on a certain page?
- Setup page template array in a custom post type
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- How do I ensure that post_type and Taxonomy use the same slug?
- pagination for custom post type archive page
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Display All Courses in Course Archive Page
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Is it possible to get the specific content on the search page?
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- open custom post type in popup window instead of page
- Set a template on a custom post in the plugin
- Persist meta box choices throughout all posts of same post type
- Do not show child pages within a file page
- Search result based on URL
- Custom search for a custom post type in WordPress
- Custom Function to redirect singular post if specific meta field is empty
- How to mix 2 kinds of post types
- CPT: execute code after load if parameter is set
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Show custom taxonomy not in submenu
- How to develop custom URL redirection
- Loop carousel slider in wordpress
- How to Fix WordPress 500 Internal server error due to custom post type
- Custom Post save causes 500 error
- Custom post tag images not displaying with ACF
- Function not pulling image or text from custom post type
- Exclude Custom Post Type from shared Custom Taxonomy
- WordPress Custom Post Type and sort by Tags
- Trying to combine multiple WordPress queries
- Looping taxonomy in taxonomy?
- Permalink of Custom Post Type
- posting twice from an array?
- Pagination not working on homepage
- Order custom post type is beign ignored
- How do I filter a custom post type loop by a field?
- How to manage wordpress knowledge base/wiki/posts collections
- Getting ACF relationship field information
- How to I add count of custom posts listed in a post as a prefix to its title