You could try the newly register_post_type_args
filter to adjust it.
Here’s an untested example:
/**
* Set 'with_front' to false for the 'experts' post type.
*/
add_filter( 'register_post_type_args', function( $args, $post_type )
{
if( 'teachers' === $post_type && is_array( $args ) )
$args['rewrite']['with_front'] = false;
return $args;
}, 99, 2 );
Updated with new info from @Agnes: the post type is teachers
not experts
.
Related Posts:
- Need help with add_rewrite_rule
- Get current URL (permalink) without /page/{pagenum}/
- How to get pretty URLs with add_query_arg in permalinks
- How does wordpress keep track of post id when post id is not used in permalinks?
- Permalink with sub-sub-category and post name
- Remove index.php in permalink structure on IIS server
- URL rewrite based on a custom field value
- How to create a permalink structure for posts in a specific category
- How to map permalinks with accented letters to sanitized slugs?
- Using two permalinks for one post
- How to use first tag in permalinks
- Changing URL from /%postname%/%post_id to /%category%/%postname%/%post_id%
- Put post ID on the custom post type URL
- How to change the permalink structure of a master page?
- Permalinks without subdirectories
- Does WordPress send a 301 header message when you change permalink structures?
- Remove the Parent category from the permalink but leave the child category
- shortcode to output multiple images urls from media library id
- How to generate random numeric slugs for a custom post type?
- WP Site in subdirectory Joomla! Site – Permalinks not working
- Trying to get property of non-object when using get_post_permalink()
- How to get full content including template HTML
- I copied my site to another site but all links point to old site
- WordPress on Ubuntu 12.10: permalinks problem
- Attachment Page Permalink/URL Rewrite Issue. How to change the actual rewriting?
- How to protect htaccess so it can’t be overwritten?
- How to link to current post in WordPress?
- wordpress api using rest_route for other pages
- 301 Redirects Result in 404 for WordPress Search Query Strings
- After updating to 4.8 permalinks will not work (all 404)
- Remove custom taxonomy base from URL
- How to get post object on blog template
- Editing URL character replacement
- How to make /search/ without parameters not return a 404?
- WordPress auto generates small medium and large of an image on upload, how can we guess their links?
- Get post text (by its URL) from database dump
- Plain to postname permalinks not working
- WordPress archive permalink with leaf category
- Google webmaster duplicate url issue with /page/01 /page/400
- URL rewriting: removing the site’s basename for a specific category
- Migrated from Windows to Linux. Any bulk methods for fixing case sensitivity?
- All top-level pages are using index.php as template
- Redirect all posts permalinks from “.html” to “/”
- Unable to get /%postname%/ permalinks working, 404 on all links
- How to rename ‘Tag Base’ with WPeC 3.8?
- Custom rewrite rule ignored
- Stop Images Linking to Themselves?
- Make last three words of excerpt a link
- Resolve 404 on posts without category
- Inserting a string in the middle of page’s permalink?
- When I click on a single post my browser goes to about:blank#blocked and the page is white
- 404 on internal pages, in all sites in my local server
- how to alter permalink in wordpress?
- Pagination using paginate_links
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- Permalink will not change – it wants to have -2 slug [duplicate]
- Access or edit custom generated permalinks with WP_Rewrite
- Add custom query vars to pretty permalinks
- xammp server permalink by postname not working
- Redirect after permalink changes
- Custom permalink structure only saves with index.php inserted
- the_permalink() not working
- Permalinks and page store
- All in One Seo and Permalinks
- Already have htaccess but permalink settings not working. Getting 404
- Change pemalink for one single post without redirect
- Add .html permalink to post if specific category
- rewrite based slug standar post wp
- How to update wordpress permalink structure with author role?
- How to turn a custom query string into permalink?
- How can i fix my permalinks?
- Edit Post Permalink option removed, looking for possible causes
- Site Tagline ended up in permalink
- Custom structure permalink preventing 404
- Flush rewrite rules with scheduled event (cron)
- I have a 404 error on all my pages! What do I do?
- Add slug to default post permalinks ONLY
- Getting 400 Bad request Error when trying to open posts after updating to wordpress 5.0
- Category Base permalinks
- Propper way to set anchor and url param
- Do shortcodes in title before permalink is generated
- Pretty Filter URL
- Add URL to selected post in meta box
- How to change dynamic link to relevant post
- Auto-generated pretty permalink not using title since 4.4 update
- Problems with permalinks after update wordpress 4.2
- Prevent guessing slug
- Pretty permalinks to work for lighttpd webserver?
- Customize category permalinks
- Latin character conversion
- Update permalinks
- Losing the original URL when using add_rewrite_rule
- broken permalinks in responsive layout
- permalinks url with woocommerce
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- WordPress keep redirecting me to random URLs
- Not recognizing my custom templates in hierarchy
- How to make a permalink variable %year% become two digits instead of four digits?
- Standard Htaccess directives disappear by themselves
- My permalinks no longer have the “news” category prefix in the link and it’s causing 404 errors for articles published on the web