• I want to remove “custom taxonomy slug” “category” from the URL.

    How can I do that?

    • This topic was modified 5 years, 8 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Go to Settings > Permalinks and select “Post name”. Save changes.

    If that doesn’t do it, a plugin or your theme is overriding this setting. Figure out which by switching themes and selectively deactivating plugins. Revisit the permalinks setting after each change, then check which permalinks are used when you view a post from the posts list screen. Get with the responsible developer for possible methods of removing the category portion of the permalink.

    Thread Starter Rakesh Raja

    (@rakeshraja)

    I guess I haven’t explained myself well. Sorry about that. I am a developer myself! I know what I am doing and what I need is something complex.

    please check URL https://wordpress-234187-797144.cloudwaysapps.com/distributors/category/africa/egypt/

    “category” is my “custom taxonomy” base URL/slug. I want to remove this from URL. Is working fine when I visit “terms” like Africa or Egypt.

    Hope it’s clear now.

    Moderator bcworkz

    (@bcworkz)

    I get what it is, I’m not sure how it got that way if it is not defined on the permalinks setting screen. The best approach is to reverse whatever introduced the permastruct to begin with by using a later hook priority. If add_permastruct() was called from init action, priority 10, then call it again with the desired permastruct from init action with priority 20.

    Another approach is to fiddle with the global $wp_rewrite object’s properties directly. This still needs to be done with a later priority to the same hook used to add the taxonomy term element to start with. If it’s not clear what was done, the original call was likely “init” action priority 10. Visit the permalinks settings screen after making changes to update the rewrite rules.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove custom taxonomy slug from URL’ is closed to new replies.