since WP 4.4.0, you can use this filter that allows you to change the arguments used in the original cpt registration.
Add this to your functions.php file:
add_filter( 'register_post_type_args', function( $args, $post_type ) {
if( 'wyde_portfolio' === $post_type && is_array( $args ) )
$args['rewrite']['with_front'] = false;
return $args;
}, 99, 2 );
It’s taken from a recent answer, https://wordpress.stackexchange.com/a/224376/39150
Hope it helps!
Related Posts:
- Custom page slug without creating a WP page
- Redirect to another page using contact form 7? [closed]
- Rewrite/Change custom taxonomy slug
- Tips for using WordPress as a CMS? [closed]
- Custom Post Type Templates from Plugin Folder?
- to perform the requested action wordpress needs to access your web server. please enter your ftp
- Disable plugin / plugin action via theme
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- Custom pages with plugin
- Hide prices and checkout functionality in woocommerce
- How can I find plugins’ slug?
- How do I exclude plugins from getting automatically updated?
- Where can I sell WordPress themes and plugins? [closed]
- How to check if a theme is active?
- how to get path to images in the uploads folder to be used in a plugin
- How to maintain W3C standards compliance of a theme
- Difference between a theme and a plugin?
- What are the package and subpackage comment for?
- How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?
- Shared functionality in plugins and themes
- Experiences with adding Nonces to the comment form
- How to add favicon to my site – in both front end and admin panel
- How to get the active theme’s slug?
- Create theme files for plugin
- How to add plugins to wordpress theme?
- How can I have two different urls for the same page that load two different templates?
- Add rewrite rule to permalink structure
- Plugin (or Theme) containing its own Plugins?
- Reordering themes in admin panel
- All shortcodes not working on custom theme
- How to enable edit button in the theme’s customize UI?
- Disable plugins on cron and ajax page
- Add Rewrite Rule for custom page
- How Do I add a redirect rule to WordPress?
- Need to create a Theme demo site that features multiple themes
- add_rewrite_rule, plugin activation and plugin deactivation
- Is it good practice to remove redundant plugins and themes?
- Ship plugin with a custom theme
- Get URL of a specific file
- Disable author pages for specific users
- Set active theme via URL
- Declare a function before plugin does on the theme functions.php file
- How get list of updates of wp site?
- How to solve a conflict between a plugin and a theme?
- WP Config for FTP credentials
- How do I make my wordpress page more friendly for mobile viewers?
- WordPress error – PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata()
- How can I list only sites that use a particular theme or plugin?
- Which hook callback has priority if both plugin and theme use the same hook?
- Using rewrite rule to access a view of a plugin from home page
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Prevent page slug from interfering with custom post type archive permalink?
- Custom rewrite rule is not picked by WordPress
- disable active plugins for specific theme
- flush rewrite rules doesn’t flush them (still got 404)
- How to prefix `attachment` permalinks with `attachment`?
- Alter post slug by a filter that is fired just after a post is created
- Check javascript file Proper way in functions.php
- Should I use RIPS tool to test my themes and plugins?
- Make the css of the widget overwrite theme css
- Themes VS Plugins [duplicate]
- 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
- Force wordpress to request for FTP Info on theme/plugin install/update
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- A way to sort WordPress themes? [closed]
- Why users disable the WordPress update?
- Can a WordPress plugin or theme contain a virus?
- dequeue not work
- Whats the difference between Page Builder Plugins and Theme Builder Softwares? [closed]
- How to use load_plugin_textdomain from within a theme
- How to get Plugin Slugs?
- adding a text message beside the comment submit button
- I can’t upload a new wordpress theme from a zipped file
- Theme and Plugins sharing common libraries
- Workflow and best practice for documentation [closed]
- Is there a quick way to inject i18n domain into theme/plugin files?
- How do I get slug of all active plugins programmatically?
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Get list of sites that uses specific plugin or theme
- How can I rewrite a plugin generated URL?
- flush_rewrite_rules() not working on plugin activation
- Override the core function locate_template
- What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?
- WordPress site migration addvice
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- WordPress custom URL Rewrites redirecting not masking
- Recommendations for books/resource to get started with wordpress 3 development (plugins/themes) [closed]
- Uncaught Error: Call to undefined function get_user_by() after moving function from theme to plugin
- Can I share predefined fonts from theme_support with a gutenberg component?
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- How can I measure the performance of any WordPress Plugin or Theme?
- Translating plugin inside the theme [closed]
- How to add rewrite rules and pagination to retrieve attachments files?
- Why are some of my thumbnails not being generated?
- How to Implement “Notice: This theme recommands the following plugin:xyz” in wordpress? [closed]
- Making menu link open in new tab?
- Woocommerce sidebar not loading in theme
- Include Max mega menu Plugin into theme
- add_action in functions.php, do_action in plugin?