Is it possible to remove ‘group’ from the buddypress groups slug?
for example:
example.com/groups/third-party-components-plugins/forum/
to be
example.com/third-party-components-plugins/forum/
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIs it possible to remove ‘group’ from the buddypress groups slug?
for example:
example.com/groups/third-party-components-plugins/forum/
to be
example.com/third-party-components-plugins/forum/
Pretty sure that is not possible.
The groups component uses a page to serve as the directory & slug provider for groups. A page cannot have an empty slug.
You can filter bp_get_groups_root_slug
but returning an empty value just breaks all group URLs and doesn't affect the component page, which still uses whatever slug you've defined for that page. So the directory page works, but all group pages are 404s if you override the page's slug to be empty (or any other value unless you handle that explicitly somewhere).
You may be able to get close to what you want with web server rewrites or other related configuration. You'd probably have to handle that nonstandard behavior with additional code in various buddypress filters, depending on whether you care if the server or application can redirect or should natively understand the rewritten URLs.