Title: Custom post type rewrites url structure
Last modified: November 14, 2019

---

# Custom post type rewrites url structure

 *  [markostancic](https://wordpress.org/support/users/markostancic/)
 * (@markostancic)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-rewrites-url-structure/)
 * We have custom post type and custom taxonomy for that custom post type. We have
   problem with url rewriting.
    Current url structure is: _[ redundant link removed]_
 * Term “proizvodi” is custom post type
    Term “kategorija_proizvoda” is custom taxonomy
   slug Term “opsta-rasveta” is name of the custom taxonomy
 * We need url structure like this:
    /sr/proizvodi/opsta-rasveta/
 * Custom post type is made with CPT UI plugin with newest version 1.6.2 and wordpress
   version 5.2.4
 * We tried using CPT UI’s Custom Rewrite Slug option, we could remove the custom
   taxonomy slug with “/”, but it redirect to 404 error page.
 * We tried plugin Remove Taxonomy Base, it removed from url but also is showing
   error page 404.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-post-type-rewrites-url-structure%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-rewrites-url-structure/#post-12099916)
 * The rewrite slugs declared with custom objects has some limitations. You can 
   create arbitrary permastructs with `add_rewrite_rule()`, but you must plan carefully.
   If there is any ambiguity, something or another will fail to work as desired.
   Using a CPT slug as part of a taxonomy URL could be problematic because WP will
   try to query for post types and not taxonomy terms. It’s better to not use it
   or use a synonym so WP does not get confused.
 * Your explanation of terms is not clear to me. CPT I get. Which is the taxonomy
   name slug and which is that taxonomy’s term slug? I’m assuming kategorija_proizvoda
   is the taxonomy and is its term that is assigned to certain CPT posts. If so,
   what I said above is correct.
 *  Thread Starter [markostancic](https://wordpress.org/support/users/markostancic/)
 * (@markostancic)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-rewrites-url-structure/#post-12101720)
 * Thank you for your reply.
 * Taxonomy name is “kategorija_proizvoda”, and Taxonomy term is “opsta-rasveta”

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom post type rewrites url structure’ is closed to new replies.

## Tags

 * [cpt](https://wordpress.org/support/topic-tag/cpt/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [slug](https://wordpress.org/support/topic-tag/slug/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [markostancic](https://wordpress.org/support/users/markostancic/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-rewrites-url-structure/#post-12101720)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
