• Resolved timatthias

    (@timatthias)


    Hello,

    the CPT UI plugin is great.

    But I don`t know, what I should do, that the slug is not in the url.

    This is the link of the post:
    https://crowdinvesting-compact.de/bonus/marvest-bonus-rabatt/
    >> I want the url without the “/bonus”

    Can I adjust it over the plugin CPT UI in the defined custom post type?

    If this is not possible, what should I do?

    Many thanks for support, Timo

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

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    It’s not possible with CPTUI alone, as it requires actively modifying the incoming permalink request, as well as the query being made. I adapted and published a post on this topic over at https://michaelbox.net/2020/06/slugless-post-type-permalinks/ with code examples and greater explanation.

    The main reason why it’s good to have the post type slug in the URL is because by default, WordPress only looks for the post’s slug in the “post” and page post types, which would not have a match. Having the post type slug in there, makes WordPress look only in that post type, for which there would be a match. The post covers that by telling WordPress to check for all 3 in cases of no extra slug present.

    Hopefully that makes sense but I’m willing to answer extra questions if you have them.

Viewing 1 replies (of 1 total)
  • The topic ‘CPT UI – URL without the slug of the post type’ is closed to new replies.