When you register cpt and taxonomies, remove the rewrite
argument completely (use the default) and then go to your dashboard, and from Settings > Permalinks set permalink structure to (Custom Structure) and type
/my-custom-slug/%postname%
Screenshots:
The setting:
The result:
save changes, and everything should be just like you want.
Related Posts:
- How to Rewrite WordPress URL for a Plugin
- Rewrite url for existing page without flush_rewrite_rules
- How to change the URL pattern for single post view
- Why doesn’t flush_rewrite_rules run on plugin activation?
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Adding rewrite rule dynamically
- rewrite URL based on selected taxonomy for post page
- add_rewrite_rule behaving strangely
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- How can I add rewrite rules to a class-based plugin?
- configuration of .htaccess for add_rewrite_rule to make sense
- Custom post type change permalink query
- Using meta_key & meta_value in add_rewrite_rule
- Any way to make Apache’s internal redirect work?
- add_rewrite_rule not working
- How to Rewrite WordPress URL for a Plugin
- Virtual Page with Registration form
- How to Rewrite WordPress URL for a Plugin
- URL rewrite parameter lost (add_rewrite_rule)
- A tool to analyze rewrite rules? [closed]
- Custom pages with plugin
- Making a plugin file accessible via url rewrite?
- Add rewrite rule to permalink structure
- Custom frontend page for plugin without a ‘physical’ page?
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom Rewriting to Plugin with Parameters
- Plugin to Consume a Web Service
- Filter to change the content of 404 page
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- Mapping multiple URLs to same page
- External Rewrite Rules
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Custom rewrite rule serves content, but returns 404 error code
- flush_rewrite_rules() not working on plugin activation
- URL rewriting must be activated manually for my plugin
- How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as “page” in WP 5.5?
- Redirect traffic to plugin
- Custom url for a plugin page add_rewrite_rule WordPress
- Append country to ‘pretty’ url but serve same page
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Help With Rewrite_Rules For a Custom Plug-In
- WordPress Custom URL
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- Possible to get all posts with my shortcode?
- Create page (not the post type) dynamically
- How to grab query string from wp-content/uploads/.*
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Forward an old url rewrite scheme to a new one?
- Plugin architecture to pull from API & create dynamic content on WP site?
- Rewriting Image URLs from dynamic to original
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom Path for a Plugin
- Access to the template file of a plug-in
- Rewrite not working since upgrade to 5.9
- Add variables from rewrite rules to query var
- Change cannonical URL after changing url with add_rewrite_rule()
- WordPress rewrite rule depend on meta values not ids
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- WordPress Own Rewrite Rules
- WordPress custom url without using any of the custom tags given
- How to force download a plugin generated file?
- How to pass a more variable with page/subpage in Wordprees URL?
- Custom pages with plugin
- Rewriting URLs with a query string
- How can I map a specific URL pattern to a plugin for processing
- How can I send an id over the url?
- Apache rewrite rules and wordpress problem
- Mapping multiple URLs to same page
- Use custom clean URLs for a plug in
- How to use permalink query to go to specific tabs in posts
- redirect word-press page with page values
- Custom rewrite, url path with parameters to a page
- Pretty URLs for dynamically created product and pagination pages
- Modifying rewrite rules to use /category//
- How to hide page links from theme menu
- Get post thumbnail in WP_Query
- Brainstorm – Slow Query from Plugin Need to Speed It Up
- How can I save a password securely as a settings field
- How can I set up a secondary permalink structure?
- Rewrite rule not passing variable
- Unexpected T_FUNCTION
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- Plugin settings are saving but the fields
- Plugin can’t be activated [closed]
- How to make a cronjob type plugin
- How to avoid conflict of plugin style and theme style?
- How do I debug an error that a plugin is causing?
- Adding an external stylesheet to a plugin
- How to use wp rewrite to hide form action url?
- Ajax +wordpress onClick link redirect to new page and create html content
- WP_NAV_MENU filter targets all menus
- Clean way to initialize plugin in newly-added site when plugin has been network activated?